about Enum.values() memory allocation

nezih yigitbasi nezihyigitbasi at gmail.com
Wed Jul 25 05:23:57 UTC 2018

I recently noticed in our app that Enum.values() allocates a significant
amount of memory when called in a tight loop as it clones the constant
values array (which is probably for immutability, and I can understand
that). I found that the same issue has been discussed back in 2012:

Are there any plans to address this issue going forward?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20180724/03b50697/attachment.html>

More information about the compiler-dev mailing list