T
threasher
I have a Java application running on Soliaris. When I use the top
command, I can see this:
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
29042 ownecx 17 29 10 81M 29M sleep 0:11 14.74% java
The value SIZE is always 81M, and RES is 29M.
When I added -Xmx1K to the application, I thought the application
would throw OutOfMemoryError due to insufficient heap space. But it
didn't, and it still runs fine, and using top command shows that SIZE
is still 81M and RES is still 29M. How can that be? In fact, whatever
value I give for -Xmx does not seem to make any difference at all.
Then I wrote a really simple program with just a couple of lines to
take up some memory. This time, when I play around with -Xmx, it does
throw OutOfMemoryError if the value is too low.
So how come that application is so special? The -Xmx does not make a
difference at all.
command, I can see this:
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
29042 ownecx 17 29 10 81M 29M sleep 0:11 14.74% java
The value SIZE is always 81M, and RES is 29M.
When I added -Xmx1K to the application, I thought the application
would throw OutOfMemoryError due to insufficient heap space. But it
didn't, and it still runs fine, and using top command shows that SIZE
is still 81M and RES is still 29M. How can that be? In fact, whatever
value I give for -Xmx does not seem to make any difference at all.
Then I wrote a really simple program with just a couple of lines to
take up some memory. This time, when I play around with -Xmx, it does
throw OutOfMemoryError if the value is too low.
So how come that application is so special? The -Xmx does not make a
difference at all.