| | 8 | |
|---|
| | 9 | PRG="$0" |
|---|
| | 10 | |
|---|
| | 11 | usage() { |
|---|
| | 12 | echo " $PRG [-heap size] [-newsize size] " |
|---|
| | 13 | echo "" |
|---|
| | 14 | echo " where:" |
|---|
| | 15 | echo "" |
|---|
| | 16 | echo " -heap sets the heap size and should be n for bytes" |
|---|
| | 17 | echo " nK for kilo-bytes" |
|---|
| | 18 | echo " nM for mega-bytes" |
|---|
| | 19 | echo " nG for giga-bytes" |
|---|
| | 20 | echo "" |
|---|
| | 21 | echo " -newsize sets the new generation size and has the same form as -heap" |
|---|
| | 22 | echo " the value should be around one third of the heap" |
|---|
| | 23 | echo "" |
|---|
| | 24 | echo " -permsize sets the permgen size and has the same form as -heap" |
|---|
| | 25 | echo " The value should probably not be less than 256M" |
|---|
| | 26 | echo "" |
|---|
| | 27 | } |
|---|
| | 28 | |
|---|
| | 29 | heap="1G" |
|---|
| | 30 | newsize="330M" |
|---|
| | 31 | permsize="256M" |
|---|
| | 32 | |
|---|
| | 33 | while [ "$1" != "" ] |
|---|
| | 34 | do |
|---|
| | 35 | # Process the next arg |
|---|
| | 36 | case $1 # Look at $1 |
|---|
| | 37 | in |
|---|
| | 38 | -usage | -help | -? | ?) |
|---|
| | 39 | usage |
|---|
| | 40 | exit |
|---|
| | 41 | shift |
|---|
| | 42 | ;; |
|---|
| | 43 | -heap) # Heap size bytes or nK, nM, nG |
|---|
| | 44 | shift |
|---|
| | 45 | heap="$1" |
|---|
| | 46 | shift |
|---|
| | 47 | ;; |
|---|
| | 48 | -newsize) |
|---|
| | 49 | shift |
|---|
| | 50 | newsize="$1" |
|---|
| | 51 | shift |
|---|
| | 52 | ;; |
|---|
| | 53 | -permsize) |
|---|
| | 54 | shift |
|---|
| | 55 | permsize="$1" |
|---|
| | 56 | shift |
|---|
| | 57 | ;; |
|---|
| | 58 | *) |
|---|
| | 59 | usage |
|---|
| | 60 | exit 1 |
|---|
| | 61 | ;; |
|---|
| | 62 | esac |
|---|
| | 63 | done |
|---|