#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    1
    Rep Power
    0

    Memory Management Help


    Hi All,
    I was running an java application in unix machines , during load for 20 hrs in last 5 hrs every 1 hour virtual memory is increasing by 2 MB though RES memory is stable so my friend is saying the application has memory leak..below is a hour wise load stat using top command. my question is 1.) whether increase in virtual memory means memory leak? 2.) Which column in top stats has to be considered for memory usage?.

    PID USER PR NI VIRT RES SHR S %CPU MEM TIME+ COMMAND
    15358 root 16 0 1237m 108m 8660 S 36 1.3 22:23.28 java -jar SCC.jar
    15358 root 16 0 1242m 114m 8660 S 38 1.4 45:50.99 java -jar SCC.jar
    15358 root 16 0 1245m 120m 8660 S 40 1.5 69:05.29 java -jar SCC.jar
    15358 root 16 0 1246m 115m 8660 S 42 1.4 92:14.87 java -jar SCC.jar
    15358 root 16 0 1251m 131m 8660 S 34 1.6 115:13.67 java -jar SCC.jar
    15358 root 16 0 1251m 117m 8660 S 40 1.4 138:25.46 java -jar SCC.jar
    15358 root 16 0 1251m 118m 8660 S 42 1.5 161:40.01 java -jar SCC.jar
    15358 root 16 0 1251m 120m 8660 S 36 1.5 184:22.90 java -jar SCC.jar
    15358 root 16 0 1251m 125m 8660 S 36 1.6 207:05.78 java -jar SCC.jar
    15358 root 16 0 1251m 114m 8660 S 36 1.4 229:45.79 java -jar SCC.jar
    15358 root 16 0 1251m 115m 8660 S 38 1.4 252:30.44 java -jar SCC.jar
    15358 root 16 0 1251m 115m 8660 S 38 1.4 275:28.83 java -jar SCC.jar
    15358 root 16 0 1251m 127m 8660 S 36 1.6 298:27.71 java -jar SCC.jar
    15358 root 16 0 1251m 116m 8660 S 38 1.4 321:23.06 java -jar SCC.jar
    15358 root 16 0 1252m 128m 8660 S 44 1.6 343:01.24 java -jar SCC.jar
    15358 root 16 0 1254m 116m 8660 S 28 1.4 363:40.06 java -jar SCC.jar
    15358 root 16 0 1256m 124m 8660 S 38 1.5 384:09.08 java -jar SCC.jar
    15358 root 16 0 1258m 137m 8660 S 38 1.7 404:35.57 java -jar SCC.jar
    15358 root 16 0 1260m 116m 8660 S 36 1.4 424:58.73 java -jar SCC.jar
    15358 root 16 0 1262m 125m 8660 S 36 1.5 445:28.48 java -jar SCC.jar
    15358 root 16 0 1264m 114m 8660 S 2 1.4 446:32.20 java -jar SCC.jar
    15358 root 16 0 1264m 113m 8660 S 0 1.4 446:34.64 java -jar SCC.jar
    15358 root 16 0 1264m 113m 8660 S 0 1.4 446:36.82 java -jar SCC.jar
    15358 root 16 0 1264m 113m 8660 S 0 1.4 446:38.95 java -jar SCC.jar
    15358 root 16 0 1264m 114m 8660 S 0 1.4 446:41.10 java -jar SCC.jar


    Regards,
    Prem
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Location
    Usually Japan when not on contract
    Posts
    240
    Rep Power
    12
    It depends which kernel you're running and which JVM. Newer kernels aggressively cache things in memory now, so free + used often total (way) more than the system has. That and Java programs are horrible memory hogs (a result of the "I might need it at some point, so I'll go ahead and allocate it all forever" strategy).

    That said, programs written in fully GCd languages don't have memory leaks; the underlying runtimes do. (It is possible to deliberately bloat memory usage in any language, however.)

    That said, a simple glance at top isn't enough to diagnose a problem, nor to identify one.

IMN logo majestic logo threadwatch logo seochat tools logo