Skip to content

Commit

Permalink
Merge pull request eclipse-openj9#21290 from amicic/softmx_test_touch
Browse files Browse the repository at this point in the history
SoftMx test, touch memory
  • Loading branch information
pshipton authored Mar 5, 2025
2 parents de6f631 + 40febba commit 7ce2c01
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ public boolean usePercentageOfHeap( double percentage ) {
try {
while ( ibmMemoryMBean.getHeapMemoryUsage().getCommitted() < ((long) ( original_softmx_value * percentage ))){
try {
myObjects[i] = new byte[OBJECT_SIZE];
byte myObject[] = new byte[OBJECT_SIZE];

myObjects[i] = myObject;

for (int j = 0; j < OBJECT_SIZE; j += 4 * 1024) {
myObject[j] = (byte)(i + 1);
}

i++;
} catch (OutOfMemoryError e){
// at this point we stop
Expand Down

0 comments on commit 7ce2c01

Please sign in to comment.