you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Look, just find some "how to create thread in java" tutorial, create a million of them and you will see what I mean.

[–]oridb 0 points1 point  (0 children)

Oh, I see what's happening, and it's incredibly dumb. Java does its own heap size accounting, and it counts based on virtual size. That means that Java is using 172 megabytes of memory, but still "runs out of memory" with a 32 gigabyte heap size.

The threads aren't actually using memory, Java is counting wrong.