Methods will still take space in the permanent section of the heap, as classes are still loaded. But this is a one-time cost. But what should be the difference between a single static enum member and a static member in a normal class? IMHO it doesn't matter if the static member is part of an enum or part of a "normal" class. The only advantage of an non-enum is the possibility of lazy initialisation. So my suggestion would probably be more on the line of lazy initialisation required and not on memory consumption.
As Vincent already said, the article above is quite old (and volatile will help), but AFAIK the memory model didn't change and the overall problem is still valid today.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Methods will still take space in the permanent section of the heap, as classes are still loaded. But this is a one-time cost. But what should be the difference between a single static enum member and a static member in a normal class? IMHO it doesn't matter if the static member is part of an enum or part of a "normal" class. The only advantage of an non-enum is the possibility of lazy initialisation. So my suggestion would probably be more on the line of lazy initialisation required and not on memory consumption.
As Vincent already said, the article above is quite old (and volatile will help), but AFAIK the memory model didn't change and the overall problem is still valid today.