Hi Albert,
The only downside of the WhiteBox API is the need to link and run with
native code.
It make adhoc testing more difficult.
I would not say ForceGC relies on chance, since it is testing the
specific condition as requested by the caller.
It uses mechanisms available to normal applications and conditions they
would encounter and not wait longer than necessary.
Regards, Roger
On 3/6/23 8:51 AM, Albert Yang wrote:
Upon a cursory inspection of ForceGC.java, it seems that the fundamental logic
involves waiting for a certain duration and relying on chance. However, I am of
the opinion that utilizing the WhiteBox API can provide greater determinism and
potentially strengthen some of the assertions.
I decided ForceGC is simpler and easier to use
I was not aware of your specific requirements, so I cannot say for certain
which approach is best. (However, it is worth noting that the WhiteBox API can
be utilized to implement ForceGC if necessary.)
/Albert