jvm memory usage on Linux

Discussion in 'Java' started by tlo, Jul 17, 2007.

  1. tlo

    tlo Guest

    Hi,

    I have a program where the main program runs a TimerTask every 10 sec. I have
    observed that the memory usage when running the commands " top" and "ps -aux"
    on the Linux box slowly increases. Over the time span of 3 hours Linux reports
    that the java process has grown approx 30kb. I have started the java process
    with the options -Xmx32M and -Xms32M (as it is running on a small hardware
    platfrom) and I can see that by using the Runtime.getRuntime() the jvm's memory
    usage looks fine:

    Total : 33357824
    Max : 33357824
    Free : 24832448
    Used : 8525376

    When looking at the top command following is displayed:
    PID USER STATUS RSS PPID %CPU %MEM COMMAND
    1544 root S 38180 1 0.0 32.2 java

    And the ps command:
    1544 root 38180 S java -Xmx32m -Xms32m main

    There are a couple of things that I don't understand:

    1. Why the Java process seems to increase in memory usage and it doesn't ever
    decrease again. The program needs to run 24/7 and I'm not sure if it will do
    this at the moment. Could this have something to do with Java program or could
    it be related to the JVM. I have tried it with Java 1.5 and Java 1.6 on Debain
    and another Linux distro with the same result.

    2. Why Linux reports the java process uses 38180kb, when I have limited the
    java heap to 32Mb.

    3. Why it increaes the memory when Java clealy have enough, is this maybe
    related to os resoures like files, sockets, etc?

    Any Help would be greatly appriciated.

    Thanks

    TLO
    tlo, Jul 17, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. metfan
    Replies:
    2
    Views:
    4,836
    Robert Olofsson
    Oct 21, 2003
  2. Soeren Gerlach
    Replies:
    0
    Views:
    430
    Soeren Gerlach
    Jul 15, 2004
  3. rony
    Replies:
    4
    Views:
    561
    Juha Laiho
    Jan 30, 2005
  4. hvt
    Replies:
    0
    Views:
    1,195
  5. tlo
    Replies:
    8
    Views:
    517
    wimpunk
    Jul 23, 2007
Loading...

Share This Page