Results 1 to 3 of 3
  1. #1
    jasonliu is offline Member
    Join Date
    Feb 2011
    Posts
    2
    Rep Power
    0

    Default Why JRE 1.6.0 is consuming more resident memory than JRE 1.4.2

    I have a system which requires running multiple JVM.

    When the system is running with JRE 1.4.2, top display is as follows. It shows each Java process is uring about 48m resident memory.

    JRE OPTIONS = -Xms32m -Xmx256m -Xss128k

    top - 23:11:59 up 1 day, 7:08, 2 users, load average: 0.17, 3.79, 4.35
    Tasks: 498 total, 1 running, 497 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.0%us, 0.0%sy, 0.0%ni, 99.9%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 24675544k total, 7490108k used, 17185436k free, 250572k buffers
    Swap: 0k total, 0k used, 0k free, 3312172k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    837179 app1 21 0 456m 56m 12m S 1.0 0.2 0:08.85 java
    850568 app2 25 0 433m 48m 14m S 0.0 0.2 0:05.69 java
    846704 app3 25 0 433m 48m 14m S 0.0 0.2 0:05.68 java
    837794 app4 25 0 433m 48m 14m S 0.0 0.2 0:05.62 java
    841158 app5 25 0 432m 48m 14m S 0.0 0.2 0:05.60 java

    If I switch to JRE 1.6.0 for the application with JRE_OPTION=-Xms32m -Xmx256m -Xss128k -XX:NewRatio=3 -XX:SurvivorRatio=6 -XX:+UseConcMarkSweepGC, the same java process is consuming about 75m resident memory.

    top - 23:16:13 up 1 day, 7:13, 2 users, load average: 11.02, 4.19, 4.15
    Tasks: 362 total, 3 running, 357 sleeping, 0 stopped, 2 zombie
    Cpu(s): 91.2%us, 5.2%sy, 0.0%ni, 3.5%id, 0.0%wa, 0.0%hi, 0.1%si, 0.0%st
    Mem: 24675544k total, 6906132k used, 17769412k free, 250676k buffers
    Swap: 0k total, 0k used, 0k free, 3362652k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    854555 app1 25 0 460m 77m 14m S 0.0 0.3 0:08.29 java
    857110 app2 25 0 459m 75m 14m S 1.0 0.3 0:08.20 java
    857846 app3 25 0 460m 75m 14m S 0.0 0.3 0:08.62 java
    856806 app4 25 0 459m 75m 14m S 0.0 0.3 0:08.39 java


    I have tried different JRE options for heap, perm size, heap ratio etc. I could not reduce the resident memory to the same level as JRE 1.4.

    The reason I need to reduce JRE1.6.0 resident memory is that my system is requiring to run 500 JVMs with 48G memory. With JRE1.4, the system is running fine. But when I switch to JRE1.6.0, I could only start about 300 JVMs.

    I am wondering why JRE 1.6.0 is consuming more resident memory than JRE1.4. Is there any way I can change JRE1.6.0 to use similiar resident memory as JRE 1.4 ? I appreciate if someone may help me on this issue.

  2. #2
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    If you don't want it to use more than 48m per JVM, then why do you have -Xmx256m?

    Personally, I don't think it's reasonable to expect the memory footprint to remain constant over the course of 9 years.

  3. #3
    jasonliu is offline Member
    Join Date
    Feb 2011
    Posts
    2
    Rep Power
    0

    Default

    I changed -Xmx64m, here's the top output

    top - 16:19:14 up 4:58, 1 user, load average: 0.24, 2.30, 1.50
    Tasks: 498 total, 1 running, 497 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.1%us, 0.1%sy, 0.0%ni, 99.9%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 24675544k total, 6640648k used, 18034896k free, 42840k buffers
    Swap: 0k total, 0k used, 0k free, 283128k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    12947 app1 25 0 268m 78m 14m S 0.0 0.3 0:08.32 java
    7559 app2 25 0 270m 78m 14m S 0.0 0.3 0:08.20 java
    18149 app3 25 0 268m 78m 14m S 0.0 0.3 0:08.33 java
    19392 app4 25 0 268m 77m 14m S 0.0 0.3 0:08.18 java
    4801 app4 19 0 268m 77m 14m S 0.0 0.3 0:08.19 java


    It seems that -Xmx256 or -Xmx64m has no much effect on resident memory.

    I do not feel the resident memory size change between JRE1.6 and JRE1.4 is related to JVM system library footprint changes. The reason is that even I enable class data sharing -Xshare:on to share system jar with classes.jsa. The shared memory increased from 8M to 14M. It means each JVM save about 5M. But it does not really reduce RES memory much

    I run pmap -x for the application with JRE 1.4 . Here's the output. I can see many application jar file partially in resident memory, and partially in virtual memory.

    Address Kbytes RSS Dirty Mode Mapping
    00000000dd80c000 16 12 0 r-xs- dbregsrv_c.jar
    00000000dd810000 464 40 0 r-xs- ecore.jar
    00000000dd884000 124 16 0 r-xs- jndi.jar
    00000000dd8a3000 244 20 0 r-xs- dnsjava.jar
    00000000dd8e0000 112 16 0 r-xs- utils.jar


    With JRE 1.6 and pmap -x on the jave process, here's the output. It seems for each application jar file, the size of VSS and RES is the same. Does it mean it always load the jar to RES memory.

    Address Kbytes RSS Dirty Mode Mapping
    00000000d2560000 6120 5800 0 r-xs- classes.jsa
    00000000d2b5a000 2072 0 0 rwx-- [ anon ]
    00000000d2d60000 7256 2684 2540 rwx-- classes.jsa
    00000000d3476000 5032 0 0 rwx-- [ anon ]
    00000000d3960000 888 888 652 rwx-- classes.jsa
    00000000d3a3e000 3208 0 0 rwx-- [ anon ]
    00000000d3d60000 32 32 0 r-xs- classes.jsa
    00000000f394c000 8 8 0 r-xs- dbregsrv_c.jar
    00000000f394e000 36 36 0 r-xs- ecore.jar
    00000000f395a000 12 12 0 r-xs- jndi.jar

    It seems JRE1.6 and JRE1.4 are different in terms of virtual memory and resident memory usage. I am wondering if this is the reason why JRE1.6 is consuming more resident memory than JRE1.4. I appreciate if someone may provide any insight information about the JREs. Thanks.

Similar Threads

  1. Consuming Spellcheck Web Service
    By DannyArcher in forum New To Java
    Replies: 4
    Last Post: 01-01-2011, 10:33 PM
  2. Error on consuming webservice
    By lzoratto in forum CLDC and MIDP
    Replies: 0
    Last Post: 06-08-2010, 02:51 PM
  3. avoiding memory over-consuming
    By itaipee in forum New To Java
    Replies: 4
    Last Post: 12-14-2009, 12:59 PM
  4. Consuming a Web Service?
    By jaden in forum New To Java
    Replies: 0
    Last Post: 08-21-2009, 10:21 PM
  5. Consuming a Web Service using Java
    By gopikrishnatb in forum Web Frameworks
    Replies: 2
    Last Post: 03-02-2009, 10:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •