Writing jtreg tests; was Re: JTreg spawns java processes and uses all memory with CONCURRENCY=auto
jonathan.gibbons at oracle.com
Thu May 23 18:06:24 PDT 2013
I've written a first draft of some high level guidelines on writing
tests for jtreg. It is available at
The intent is that this should be general high level notes, and a place
to hang references for any more detailed docs that folk would like to see.
Comments please, but it's a long weekend here, so I may not respond
until next week.
On 05/23/2013 12:28 PM, Jonathan Gibbons wrote:
> I've incorporated some of the feedback I received here and noted the
> I am currently experimenting with the Hotspot test suite to get advice
> for that.
> I've linked the page in to the page "Running tests with jtreg", but
> not to the top level page. I'd prefer to keep the top level page
> relatively simply and well structured. That being said, it seems
> there is a need for some sort of page "Writing tests for jtreg", that
> should contain helpful info or provide pointers to useful info that is
> specific to jtreg (as compared to writing tests in general.) When
> that page appears, I think that deserves to be linked in to the top page.
> -- Jon
> On 05/21/2013 07:47 PM, Jonathan Gibbons wrote:
>> I've published a new page on the OpenJDK jtreg pages that attempts to
>> summarize the wisdom collected in this email thread.
>> The page is http://openjdk.java.net/jtreg/concurrency.html
>> The page is not yet linked in to other any pages, to give folk here a
>> chance to give feedback before the page becomes more generally
>> -- Jon
>> On 05/21/2013 12:33 AM, Alan Bateman wrote:
>>> On 20/05/2013 21:59, Tomasz Kowalczewski wrote:
>>>> during a recent "Adopt OpenJDK" event held in Krakow I was using
>>>> jtreg for running OpenJDK test cases. It was set up as per
>>>> instructions published here:
>>>> OpenJDK repository was cloned from
>>>> http://hg.openjdk.java.net/jdk8/tl and jtreg version was
>>>> I have set 'CONCURRENCY=auto' environment variable.
>>>> When running a test suite (.e.g.: 'cd jdk8_tl/test; make jdk_util')
>>>> jtreg spawns a lot of java processes and it seems not to stop.
>>>> Ever. It uses all 8 GB of RAM on my machine at which point Windows
>>>> starts killing random processes.
>>>> With 'CONCURRENCY=1' jtreg will spawn only a few java processes and
>>>> will happily run all the test.
>>>> What is the behavior for 'CONCURRENCY=auto'? Which value is used as
>>>> default? Maybe it is not a bug its just that OpenJDK tests should
>>>> be run on a big server machine with lots of RAM?
>>>> Any suggestions or pointers to documentation will be very appreciated.
>>>> Tomasz Kowalczewski
>>> If you are using -concurrency then I would also suggest adding
>>> -vmoption:-Xmx512m so that you limit the heap size of the VMs. I
>>> think Mike has a patch coming for the test Makefile to make this the
>>> On concurrency I personally find that -concurrency:auto works well
>>> for the jdk tests, assuming you limit the heap size. The reason is
>>> that the tests are a wild mix of work loads (some tests are I/O
>>> bound, some are compute bound, some spend a lot of time sleeping).
>>> The exception is Windows 32-bit where you can limit the heap but you
>>> might still run into the virtual memory limits on the system.
More information about the jtreg-use