RFR: 8213269: convert test/hotspot/jtreg/runtime/memory/RunUnitTestsConcurrently to gtest [v6]
Thomas Stuefe
stuefe at openjdk.java.net
Wed Mar 3 05:07:40 UTC 2021
On Tue, 2 Mar 2021 23:53:53 GMT, Mikhailo Seledtsov <mseledtsov at openjdk.org> wrote:
>> test/hotspot/gtest/concurrent_test_runner.inline.hpp line 74:
>>
>>> 72: Semaphore done(0);
>>> 73:
>>> 74: std::vector<UnitTestThread*> t;
>>
>> Regarding the STL question, I think using std in a limited fashion in the tests seems ok before we start allowing it in the main sources, despite where Misha pointed out it already exists. It's going to be allowed pretty soon anyway.
>> One question about this: where does it allocate memory for 't' ? Are the elements leaked here?
>
> On a question: where does it allocate memory for 't' ? Are the elements leaked here?
> The vector will allocate and free the memory for the containers (the memory containing pointers to UnitTestThread).
>
> As for the UnitTestThread objects/instances themselves:
> - JavaTestThread. I checked couple of other examples of uses of JavaTestThread (test_symbolTable.cpp and oops/test_markWord.cpp), and neither is calling explicit delete on the objects of this type
> - I presume the thread will free its resources once it exits (and we wait for done semafore to ensure this)
> - adding code “delete t[i]” results in crash, presuming due to freeing an already released memory
>
> Hence, I believe, no changes needed to this code to free resources.
> Regarding the STL question, I think using std in a limited fashion in the tests seems ok before we start allowing it in the main sources, despite where Misha pointed out it already exists. It's going to be allowed pretty soon anyway.
Really? I recently had a private discussion with Kim Barret about this and understood that this is a contentious point. I was hoping we would have a public discussion about this before deciding on this. My fears are increased build times (which seem to get worse and worse) and stability- and compiler issues. I am not completely against it, but I'm a bit of a burned child wrt to STL.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2436
More information about the hotspot-dev
mailing list