Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HyperAlloc: java.lang.NegativeArraySizeException with low values of -n #74

Open
tstuefe opened this issue Jul 13, 2024 · 1 comment
Open
Assignees

Comments

@tstuefe
Copy link

tstuefe commented Jul 13, 2024

Setting -n to a value below 40 (e..g 32) give me

java.util.concurrent.ExecutionException: java.lang.NegativeArraySizeException: -5
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
        at com.amazon.corretto.benchmark.hyperalloc.SimpleRunner.start(SimpleRunner.java:65)
        at com.amazon.corretto.benchmark.hyperalloc.HyperAlloc.main(HyperAlloc.java:13)
Caused by: java.lang.NegativeArraySizeException: -5
        at com.amazon.corretto.benchmark.hyperalloc.AllocObject.<init>(AllocObject.java:31)
        at com.amazon.corretto.benchmark.hyperalloc.AllocObject.create(AllocObject.java:100)
        at com.amazon.corretto.benchmark.hyperalloc.AllocObject.create(AllocObject.java:87)
        at com.amazon.corretto.benchmark.hyperalloc.TaskBase.lambda$createSingle$0(TaskBase.java:90)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1575)

-n 40 gives me

Exception in thread "HyperAlloc-Store" java.lang.IllegalArgumentException: bound must be positive
        at java.base/java.util.Random.nextInt(Random.java:551)
        at java.base/java.util.concurrent.ThreadLocalRandom.nextInt(ThreadLocalRandom.java:453)
        at com.amazon.corretto.benchmark.hyperalloc.AllocObject.touch(AllocObject.java:57)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
        at com.amazon.corretto.benchmark.hyperalloc.ObjectStore.reshuffle(ObjectStore.java:212)
        at com.amazon.corretto.benchmark.hyperalloc.ObjectStore.run(ObjectStore.java:126)
        at java.base/java.lang.Thread.run(Thread.java:1575)

@tstuefe
Copy link
Author

tstuefe commented Jul 13, 2024

Setting -n to a value below 40 (e..g 32) give me

java.util.concurrent.ExecutionException: java.lang.NegativeArraySizeException: -5
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
        at com.amazon.corretto.benchmark.hyperalloc.SimpleRunner.start(SimpleRunner.java:65)
        at com.amazon.corretto.benchmark.hyperalloc.HyperAlloc.main(HyperAlloc.java:13)
Caused by: java.lang.NegativeArraySizeException: -5
        at com.amazon.corretto.benchmark.hyperalloc.AllocObject.<init>(AllocObject.java:31)
        at com.amazon.corretto.benchmark.hyperalloc.AllocObject.create(AllocObject.java:100)
        at com.amazon.corretto.benchmark.hyperalloc.AllocObject.create(AllocObject.java:87)
        at com.amazon.corretto.benchmark.hyperalloc.TaskBase.lambda$createSingle$0(TaskBase.java:90)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1575)

-n 40 gives me

Exception in thread "HyperAlloc-Store" java.lang.IllegalArgumentException: bound must be positive
        at java.base/java.util.Random.nextInt(Random.java:551)
        at java.base/java.util.concurrent.ThreadLocalRandom.nextInt(ThreadLocalRandom.java:453)
        at com.amazon.corretto.benchmark.hyperalloc.AllocObject.touch(AllocObject.java:57)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
        at com.amazon.corretto.benchmark.hyperalloc.ObjectStore.reshuffle(ObjectStore.java:212)
        at com.amazon.corretto.benchmark.hyperalloc.ObjectStore.run(ObjectStore.java:126)
        at java.base/java.lang.Thread.run(Thread.java:1575)

Anything >= 48 seems to work.

@earthling-amzn earthling-amzn self-assigned this Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants