Hello, On 05/01/2019 16:05, Fu Jie wrote:
As far as I know, GC will finally be triggered if "System.gc()" is called repeatedly with the JVM flag -XX:-DisableExplicitGC.
This option is specified with -XX, which are non-standard, not stable and are subject to change without notice. So it is not necessary to use it in the test, since the same result can be achieved differently. I do not see the problem in the "limit xmx" + "throw/catch OOM" + "check the results". I guess this is only correct way to check it without possibility to introduce infinite loop which checks weakref.get(). Why don't you like it? -- Best regards, Sergey.
