Why does paketo-libjvm set direct memory to an arbitrary 10MB by default? #241
Replies: 1 comment 8 replies
-
I didn't make the original decision, but a lot of the Java decisions like this were made based on history and compatibility with the Cloud Foundry Java buildpack. So when you ask why, the answer is probably because that's how the CF Java Buildpack did it. As for why the CF Java Builidpack picks this seemingly arbitrary value, I'm not sure. That predates my involvement. I do trust that the maintainers had their reasons though, likely based on research and user feedback. Personally, I'd like to see some research into how the JVM has evolved in this area and see what we might be able to move out of the memory calculator and just let the JVM do its thing. Originally, the memory calculator was put in because it prevents container OOMEs, and the JVM had zero awareness of container limits. The JVM has been improving in this area, so maybe we can, based on the JVM version, start scaling back what the memory calculator does without risking OOMEs. I feel like when we use JVM default behaviors, that's a better user experience because it's what people naturally expect, however, preventing OOMEs is more important than that so we want to ensure we're giving users all the protection we can there. Anyway, talking out loud here. If this is an area where you're interested in doing a little research, that would certainly help. Feel free to post findings here. Beyond that, we'd probably need an RFC to propose changes of this nature. The research I mentioned would certainly help drive that RFC. |
Beta Was this translation helpful? Give feedback.
-
Just curious the reasoning behind setting -XX:MaxDirectMemorySize to 10M by default? The Java default seems to have always been set it to max memory. 10M as a default is quite a bit different than max memory.
Beta Was this translation helpful? Give feedback.
All reactions