Herong's Tutorial Notes on JVM
Dr. Herong Yang, Version 3.00, 2007

Garbage Collection

Part:   1  2  3  4  5  6  7  8  9 

(Continued from previous part...)

GCTest Program Output - Periodical Memory Requirement

In this test, I ran the same program un J2SDK 1.4.0_02 with a different parameter:

java -Xms2m -Xmx8m GCTest 16 8 > tail_16_08.out

I got the following output:

Time   Total   Free   Free   Total   Act.   Dead   Over
sec.   Mem.    Mem.   Per.   Obj.    Obj.   Obj.   Head
   0    1984   1727    87%       0      0      0    257 
   0    1984   1593    80%     128    128      0    263 
   1    1984   1464    73%     256    256      0    264 
   1    1984   1334    67%     384    384      0    266 
....                                                  
   5    1984    425    21%    1280   1280      0    279 
   5    1984    296    14%    1408   1408      0    280 
   6    3124   1451    46%    1536   1408    128    137 
   6    3124   1450    46%    1536   1536      0    138 
....                                                  
  10    3124    412    13%    2560   2560      0    152 
  11    3124    282     9%    2688   2688      0    154 
  11    5256   2303    43%    2816   2816      0    137 
  12    5256   2173    41%    2944   2944      0    139 
  12    5256   2043    38%    3072   3072      0    141 
....                                                  
  27    5256    329     6%    4736   2688   2048    191 
  27    5256    199     3%    4864   2816   2048    193 
  28    8128   2998    36%    2944   2944      0   2186
  28    8128   2868    35%    3072   3072      0   2188
  29    8128   2866    35%    3072   2944    128   2190
  29    8128   2864    35%    3072   2816    256   2192
  30    8128   2863    35%    3072   2688    384   2193
  30    8128   2861    35%    3072   2560    512   2195
....

  47    8128    754     9%    5120   2304   2816   2254
  48    8128    752     9%    5120   2176   2944   2256
  48    8128    750     9%    5120   2048   3072   2258
  49    8128    620     7%    5248   2176   3072   2260
  49    8128    491     6%    5376   2304   3072   2261
  50    8128    361     4%    5504   2432   3072   2263
  50    8128    231     2%    5632   2560   3072   2265
  51    8128   2230    27%    2688   2688      0   3210
  51    8128   2100    25%    2816   2816      0   3212
  52    8128   1970    24%    2944   2944      0   3214
  52    8128   1840    22%    3072   3072      0   3216
  53    8128   1839    22%    3072   2944    128   3217
  53    8128   1837    22%    3072   2816    256   3219
  54    8128   1835    22%    3072   2688    384   3221
  54    8128   1833    22%    3072   2560    512   3223
....
  66    8128    385     4%    4480   2432   2048   3263
  66    8128    256     3%    4608   2560   2048   3264
  67    8128   3254    40%    2688   2688      0   2186
  67    8128   3124    38%    2816   2816      0   2188
  68    8128   2995    36%    2944   2944      0   2189
  68    8128   2865    35%    3072   3072      0   2191
  69    8128   2863    35%    3072   2944    128   2193
  69    8128   2861    35%    3072   2816    256   2195
  70    8128   2860    35%    3072   2688    384   2196
  70    8128   2858    35%    3072   2560    512   2198
....
  90    8128    358     4%    5504   2432   3072   2266
  90    8128    228     2%    5632   2560   3072   2268
  91    8128   2230    27%    2688   2688      0   3210
  91    8128   2100    25%    2816   2816      0   3212
  92    8128   1970    24%    2944   2944      0   3214
  92    8128   1840    22%    3072   3072      0   3216
  93    8128   1839    22%    3072   2944    128   3217
  93    8128   1837    22%    3072   2816    256   3219
  94    8128   1835    22%    3072   2688    384   3221
  94    8128   1833    22%    3072   2560    512   3223
....

This time, the program allocated 2048KB of objects during the initialization phase. Then it started the test loop phase of allocating 1024KB of objects before release the same amount of objects.

By looking at the output, the periodic change of memory requirement between 2048KB and 3072KB had no impact on the garbarge collection process.

Then I increased the memory requirement with:

java -Xms2m -Xmx8m GCTest 16 16 > tail_16_16.out

(Continued on next part...)

Part:   1  2  3  4  5  6  7  8  9 

Dr. Herong Yang, updated in 2007
Herong's Tutorial Notes on JVM - Garbage Collection