Author Topic: Java uses most of the memory  (Read 2800 times)

EugeneTM

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Java uses most of the memory
« on: April 24, 2009, 08:46:30 »
Hello!
Code: [Select]
top - 10:43:34 up 35 days, 16:58,  1 user,  load average: 0.57, 0.49, 0.36
Tasks: 113 total,   1 running, 111 sleeping,   0 stopped,   1 zombie
Cpu(s):  1.2% us,  0.2% sy,  0.0% ni, 98.6% id,  0.0% wa,  0.0% hi,  0.0% si
Mem:   4147692k total,  4118968k used,    28724k free,    59948k buffers
Swap:  5406712k total,      184k used,  5406528k free,  3318752k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 4063 root      17   0  563m 342m  12m S 51.6  8.5 183:42.96 java

What i can do to reduce using memory by queuemetrics?

EugeneTM

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Java uses most of the memory
« Reply #1 on: April 24, 2009, 08:50:23 »
Code: [Select]

  1  [||||                                                                                     3.3%]     Tasks: 183 total, 1 running
  2  [||                                                                                       1.3%]     Load average: 0.50 0.51 0.38
  3  [|                                                                                        0.7%]     Uptime: 35 days, 17:01:45
  4  [                                                                                         0.0%]
  5  [                                                                                         0.0%]
  6  [                                                                                         0.0%]
  7  [|                                                                                        0.7%]
  8  [                                                                                         0.0%]
  Mem[|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||724/4050MB]
  Swp[|                                                                                    0/5279MB]

  PID USER     PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
 4063 root      17   0  563M  342M 12984 S  0.0  8.4  0:01.86 /usr/local/queuemetrics/java/bin/java -Xms128M -Xmx128M -Djava.endorsed.dirs=/usr/local/queuemetrics/tomcat/common/endorsed -classpath /usr/local
 4065 root      16   0  563M  342M 12984 S  0.0  8.4  0:59.02 /usr/local/queuemetrics/java/bin/java -Xms128M -Xmx128M -Djava.endorsed.dirs=/usr/local/queuemetrics/tomcat/common/endorsed -classpath /usr/local
 4066 root      16   0  563M  342M 12984 S  0.0  8.4  0:59.27 /usr/local/queuemetrics/java/bin/java -Xms128M -Xmx128M -Djava.endorsed.dirs=/usr/local/queuemetrics/tomcat/common/endorsed -classpath /usr/local
 4067 root      16   0  563M  342M 12984 S  0.0  8.4  0:59.59 /usr/local/queuemetrics/java/bin/java -Xms128M -Xmx128M -Djava.endorsed.dirs=/usr/local/queuemetrics/tomcat/common/endorsed -classpath /usr/local
 4068 root      16   0  563M  342M 12984 S  0.0  8.4  0:59.32 /usr/local/queuemetrics/java/bin/java -Xms128M -Xmx128M -Djava.endorsed.dirs=/usr/local/queuemetrics/tomcat/common/endorsed -classpath /usr/local
 4069 root      16   0  563M  342M 12984 S  0.0  8.4  0:59.43 /usr/local/queuemetrics/java/bin/java -Xms128M -Xmx128M -Djava.endorsed.dirs=/usr/local/queuemetrics/tomcat/common/endorsed -classpath /usr/local
 4070 root      15   0  563M  342M 12984 S  0.0  8.4  0:59.78 /usr/local/queuemetrics/java/bin/java -Xms128M -Xmx128M -Djava.endorsed.dirs=/usr/local/queuemetrics/tomcat/common/endorsed -classpath /usr/local
 4071 root      16   0  563M  342M 12984 S  0.0  8.4  0:59.30 /usr/local/queuemetrics/java/bin/java -Xms128M -Xmx128M -Djava.endorsed.dirs=/usr/local/queuemetrics/tomcat/common/endorsed -classpath /usr/local
 4072 root      16   0  563M  342M 12984 S  0.0  8.4  0:59.36 /usr/local/queuemetrics/java/bin/java -Xms128M -Xmx128M -Djava.endorsed.dirs=/usr/local/queuemetrics/tomcat/common/endorsed -classpath /usr/local
 4073 root      16   0  563M  342M 12984 S  0.0  8.4  0:26.52 /usr/local/queuemetrics/java/bin/java -Xms128M -Xmx128M

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Java uses most of the memory
« Reply #2 on: April 24, 2009, 09:38:46 »
This is the correct scenario for a 128M JVM - the rest of the memory is libraries and such things. If you see that the CPU is very high, you should give it more RAM - Java does garbage collection only when it needs it, so if you have twice as much heap, it will perform way less garbage collections.