Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/412#discussion_r87408752
--- Diff:
utils/common/src/test/java/org/apache/brooklyn/util/javalang/MemoryUsageTrackerTest.java
---
@@ -82,7 +82,7 @@ private long sizeOfActiveReferences(List<Maybe<byte[]>>
references) {
return size;
}
- @Test(groups="Integration")
+ @Test(groups="Live")
--- End diff --
I didn't realise that apache infra was running our integration tests.
Thanks for the link!
No strong feelings from me. Or could mark is as group "Broken" until we get
to the bottom of it. I'll play around in another PR at a possible fix. Will
ping you when that's done!
Here's the output from apache infra's run. Note that the test took `1454694
ms`, compared to 3 seconds on my laptop (I run java 7). Note how many 1M
objects we've created! I therefore believe the first (i.e. the one we check)
was not being deleted, but lots of others were. We could check for any absent,
rather than just the first.
```
2016-11-10 09:38:30,153 INFO First soft reference cleared after 1000001 1M
blocks created; 999628 of them cleared
2016-11-10 09:38:30,158 INFO TESTNG FAILED: "Surefire test" -
org.apache.brooklyn.util.javalang.MemoryUsageTrackerTest.testSoftUsageAndClearance()
finished in 1454694 ms
java.lang.AssertionError: Should have had less than 10% free memory before
clearance, had 266 MB / 716 MB expected [true] but found [false]
at
org.apache.brooklyn.util.javalang.MemoryUsageTrackerTest.testSoftUsageAndClearance(MemoryUsageTrackerTest.java:104)
```
I wonder if it's related to @drigodwin's change in
https://github.com/apache/brooklyn-server/blob/master/parent/pom.xml#L691 to
add `-XX:SoftRefLRUPolicyMSPerMB=1` (as discussed in
https://issues.apache.org/jira/browse/BROOKLYN-375). That could change the
behaviour we see, for when and how much is collected. But I wouldn't have
thought so, because that just changes the behaviour on collection (and
shouldn't trigger a collection before one is really needed).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---