Issue Details (XML | Word | Printable)

Key: NUCCORE-529
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Peter Dettman
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Core

Intermittent unit test failure of SoftValueMapTest due to OutOfMemoryError

Created: 21/May/10 07:52 AM   Updated: 11/Jun/10 01:38 PM   Resolved: 21/May/10 03:19 PM
Component/s: None
Affects Version/s: 2.1.0.m3
Fix Version/s: 2.1.0.release

File Attachments: 1. Text File NUCCORE-529.patch (1 kB)

java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

 Description  « Hide
testMemoryReclamation(org.datanucleus.util.SoftValueMapTest) Time elapsed: 58.849 sec <<< ERROR!
java.lang.OutOfMemoryError: GC overhead limit exceeded
    at java.util.Arrays.copyOfRange(
    at java.lang.String.<init>(
    at java.lang.StringBuilder.toString(
    at org.datanucleus.util.ReferenceValueMapTestCase.testMemoryReclamation(

This only started happening since I recently moved to 64 bit OS/JVM.

The exception is explained here:, where it is also explained that it can be disabled by specifying -XX:-UseGCOverheadLimit.

I have confirmed this stops the error for me by adding argLine to surefire plugin:


The problem with that is that UseGCOverheadLimit was only introduced in Java 6. An alternative that also fixes my immediate issue is to set -Xmx128m instead (as a side-benefit the test also then completes in a few seconds vs ~1 min).

I am attaching a patch that uses profiles to specify the surefire argLine based on the java version. Take your pick of the best option.

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 21/May/10 01:50 PM
I'd probably favour a
<argLine>-Xmx128m</argLine> <!-- For SoftValueMapTest -->
in the surefire plugin section as default, and then if someone wanted to enable a Java6 profile add in the other.

Personally I use JDK1.6 so not a problem, but someone somewhere may complain if we just went to that as default

Peter Dettman added a comment - 21/May/10 03:19 PM
Added the -Xmx128m for now; will revisit if the exception pops up again.