Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Edit: Turns out that BeyondJava article is just poorly written, and tries so hard to emphasise its subtle distinctions that it ends up being actively harmful to the reader's understanding. I'll leave my comment anyway.

From that article:

> Java doesn't store any object in the stack. It does store local variables on the stack: primitive types like int or boolean. It also store the pointers to objects on the stack. But it doesn't store the objects themselves on the stack. Anything you create with new is always created on the heap.

Is that true? For years now there have been articles from serious sources discussing JVM escape-analysis-based optimisations.

Is there something mistaken in the analysis in this DZone article?

https://dzone.com/articles/do-not-let-your-java-objects-esca...

How about this StackOverflow answer, which even goes into the detail of distinguishing escape-analysis, stack allocation of objects, and object deconstruction+scalar replacement:

https://stackoverflow.com/a/43002529/



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: