CDV ❯ ArrayManager "cache" can hold strong references to arrays longer than expected (preventing GC)
-
Bug
-
Status: Open
-
2 Major
-
Resolution:
-
-
-
interfaces
-
Reporter: teck
-
September 01, 2009
-
0
-
Watchers: 0
-
December 16, 2011
-
Description
Inside of the ArrayManager there is “cache” in front of the underlying maps. In an *idle system* this cache can hold references to arrays (which are not necessarily shared arrays) in the cache indefinitely.
I don’t believe this is a major problem for real world usage. Provided something is going on in the VM, there will be enough natural calls into the array manager to keep this cache churned.
The problem comes when trying to write very controlled GC tests, like this one: https://svn.terracotta.org/repo/forge/projects/tim-distributed-cache/branches/tc-3.1/tim-distributed-cache-system-tests/src/test/java/org/terracotta/cache/DistributedCacheGCTest.java
This test will sometimes fail if the block that makes lots of ArrayManager calls is removed. In this case there is network message left in the array manager refererence which through a rather complicated set of references points back to the cache which the test is trying to assert will be GCd.
If this is fixed you should be able to remove the ArrayManager calls in DistributedCacheGCTest$App