Forum Stats

  • 3,816,053 Users
  • 2,259,134 Discussions


How to evaluate garbage collection peformance (when it occur, how long taking ..etc)

edited Sep 18, 2018 9:28AM in Java Card

Dear user in community.

I'm beginner to use JavaCardOS - 3.0.4.

I'm struggling with peformance down, overhead effected by Garbage collection.

I want to evaluate it more efficiently ex) when it occur, how long taking ..etc

are there any applet to evaluate the GC peformance or any test applet like CTS ?

Any infomation, help highly appreciate.



  • owlstead
    owlstead Member Posts: 28
    edited Sep 18, 2018 9:28AM

    I think it is next to impossible to measure the performance of the garbage collector without knowing the details of the implementation. Different implementations may show very different behavior given the state, and the exact state is hard to determine without at least knowing the architecture of the memory subsystem.

    Measuring the GC using just an Applet is of course non-sense, it doesn't normally have access to a stopwatch. It would only work with a combination of applet and PC side framework.

    Generally you should try and avoid GC at all times. Only request it or release references when absolutely required, preferably do not use it "in the field". Hopefully that tip will alleviate the need for GC performance comparisons.

This discussion has been closed.