Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-releng-dev] Garbage collection in meter's methods.


Doing it in setup() is ok but how to do you do it at the end?  teardown() is too late.  As Ikuo pointed out, you need to do it after the time measurements but before the memory measurements.

Jeff



John Arthorne/Ottawa/IBM@IBMCA
Sent by: platform-releng-dev-bounces@xxxxxxxxxxx

06/15/2006 06:12 PM

Please respond to
"Eclipse platform release engineering list." <platform-releng-dev@xxxxxxxxxxx>

To
"Eclipse platform release engineering list." <platform-releng-dev@xxxxxxxxxxx>
cc
Subject
Re: [platform-releng-dev] Garbage collection in meter's methods.






It definitely makes sense to perform a gc before starting the measurement if you are testing for heap usage.  I suspect the current performance meter doesn't do this because most of our current tests are interested only in elapsed time. Note that even with explicit gc, the heap measurements are often not reliable due to various caches and weak/soft references used in the platform.  It seems to be very difficult to reliably measure memory/heap usage in automated tests.  The setUp() method sounds like a good place to do a gc.


John



Ikuo Yamasaki <yamasaki.ikuo@xxxxxxxxxxxxx>
Sent by: platform-releng-dev-bounces@xxxxxxxxxxx

15/06/2006 12:23 PM

Please respond to
"Eclipse platform release engineering list." <platform-releng-dev@xxxxxxxxxxx>

To
platform-releng-dev@xxxxxxxxxxx
cc
Subject
[platform-releng-dev] Garbage collection in meter's methods.







I'm now doing performance test regarding Equinox service registry by
extending org.eclipse.core.tests.harness.PerformanceTestRunner. I would
like to measure both of heap memory consumption and CPU time for my own test()
method.

As for the current implementation of PerformanceMeters, System.gc is not
called in meter.start()/stop(). Therefore, the results of "Used Java
Heap" might include memory allocation for objects to be garbage
collected in future. Although I understand there might be a case that it
must include memory allocation for those (kind of instantaneous), it's
not what I want (kind of constantly).

What I want the methods to do is :  

In meter.start(),
               1. do gc.
               2. record current Used Java Heap.
               3. record current time.

In meter.stop(),
               1. record current time
               2. do gc,
               3. record current Used Java Heap.

# GC must not affect the result of CPU time.

Now, could anyone tell me what I should do ?
or do you have any plan to change the implementation of PerformanceTestRunner.

P.S. Currently, Only thing I can do is calling System.gc() in my setUp()
               method.

---------------------
NTT Cyber Solutions Laboratories

   Ikuo YAMASAKI
      E-mail: yamasaki.ikuo@xxxxxxxxxxxxx


_______________________________________________
platform-releng-dev mailing list
platform-releng-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-releng-dev

_______________________________________________
platform-releng-dev mailing list
platform-releng-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-releng-dev


Back to the top