kpgalligan
01/26/2020, 7:43 PMDominaezzz
01/26/2020, 9:22 PMMutableMap
in a DetachedObjectGraph
, have you considered using DetachedObjectGraph(TransferMode.UNSAFE, ....)
when recreating the DetachedObjectGraph
? You could even use DetachedObjectGraph(TransferMode.SAFE, ....)
to limit the graph checks on the individual elements.kpgalligan
01/26/2020, 9:26 PMDominaezzz
01/26/2020, 9:28 PMDetachedObjectGraph
?kpgalligan
01/26/2020, 9:28 PMDominaezzz
01/26/2020, 9:28 PMDetachedObjectGraph
have to be explicitly released?kpgalligan
01/26/2020, 9:29 PMDominaezzz
01/26/2020, 9:29 PMkpgalligan
01/26/2020, 9:30 PMDominaezzz
01/26/2020, 9:30 PMkpgalligan
01/26/2020, 9:31 PMDominaezzz
01/27/2020, 12:28 AMMutableMap
can stay completely detached.kpgalligan
01/27/2020, 12:34 AMDetachedObjectGraph
for anything besides a comparison benchmark, I didn’t dig too deep.testBasicThreads
has errors that look like memory related race conditions.
[ RUN ] DetachedMapTest.testInitFrozen
[ OK ] DetachedMapTest.testInitFrozen (0 ms)
[ RUN ] DetachedMapTest.testBasicThreads
basic threads time: 1.23ms
kotlin.AssertionError: Expected <62>, actual <1850>.
/Users/teamcity3/buildAgent/work/4d622a065c544371/runtime/src/main/cpp/Memory.cpp:1091: runtime assert: Must be positive
Abort trap: 6
Kevins-MacBook-Pro-5:FrozenStructures kgalligan$
Dominaezzz
01/28/2020, 1:41 PMkpgalligan
01/28/2020, 2:18 PM[ RUN ] DetachedMapTest.testInitFrozen
[ OK ] DetachedMapTest.testInitFrozen (0 ms)
[ RUN ] DetachedMapTest.testBasicThreads
basic threads time: 160ms
kotlin.AssertionError: Expected <1881>, actual <1850>.
/Users/teamcity3/buildAgent/work/4d622a065c544371/runtime/src/main/cpp/Memory.cpp:1091: runtime assert: Must be positive
Illegal instruction: 4
Memory.cpp
asserts are benign. Also, the actual count check is wrong, obviously. Not sure which check that is, though.Dominaezzz
01/28/2020, 2:42 PMkpgalligan
01/28/2020, 2:48 PMDominaezzz
01/28/2020, 3:03 PMGC.collect()
before detaching.
The multi-threaded test failed because waitForMultipleFutures(workers.map { it.requestTermination() }, 5000)
only waits for a single future, very misleading name. So waiting for the workers manually, fixes the race condition in the test.