News for hackers. Stuff that matters.
Re:DRAM Prices in ‘Freefall’ by ben_w on Thursday March 07, 2019 @03:12PM (#19331825)
Java is not inherently a memory hog. I used to work for a game developer which will remain unnamed, all their stuff was Java based, and they used 64-128 MB. That included a full 3D engine and textures.
Re:DRAM Prices in ‘Freefall’ by erik_seaberg on Thursday March 07, 2019 @04:10PM (#19332484)
Java's boxing (you can't put an int in a HashMap without first copying it to the heap) and lack of value types (basically the same problem for structs) does impose some extra object references and headers other languages wouldn't require.
Re:DRAM Prices in ‘Freefall’ by Jach on Thursday March 07, 2019 @04:39PM (#19332750)
It's not that much overhead and Java has successfully been used in the embedded space for a long time. (The JVM is separate from the Java language.) From today's wiki page on embedded java, "Embedded Java minimal requirements start at 30KB of (internal) flash and less than 2KB of (internal) RAM." Sure sometimes you can't even meet that, but that's hardly Java's fault.
Re:DRAM Prices in ‘Freefall’ by deathanatos on Thursday March 07, 2019 @04:49PM (#19332857)
IME, it's not so much the amount of memory¹, as the pressure it places on the GC to keep up w/ these (often small, but numerous) allocations. Other languages can allocate and deallocate these types of structures with just a stack pointer move in both cases, since nothing ever leaves the stack. (I think Java's allocator is typically approximately or exactly as cheap as a pointer-move on allocation, but deallocation is another story.)

¹but I don't want to downplay this concern entirely; in the parent's case of an int needing boxing, that effectively doubles the cost: the int, and now the pointer to that int. (Plus any hidden requirements of the allocator, but even if we assume that's free, the story might still be plenty grim.)

Re:DRAM Prices in ‘Freefall’ by imtringued on Friday March 08, 2019 @07:15AM (#19336872)
>that effectively doubles the cost: the int, and now the pointer to that int.

Empty objects aren't free either, so you pay triple.