Hacker News new | past | comments | ask | show | jobs | submit login

> What makes a difference is gc pauses. Imho if you can live without managed memory. You can do this in java as well and eliminate gc pauses.

Wait, how can you turn off GC'd managed memory in Java, and do it yourself? I didn't know you could do that in Java?




You don't turn it off, but you can use off-heap memory (with direct ByteBuffers) and manage it yourself. Some Java applications manage some part of their memory off-heap, but this is a bad idea unless the allocated objects have a well-defined lifecycle.


Now everyone will tell you that you can use ByteBuffer or sun.misc.Unsafe to keep memory off-heap and hence out of sight of the GC.

BUT what that means is that you have create your own custom implementations of the data structures you need and you'll have to write your own memory allocator.

Unless that memory area holds just a simple data BLOB (like a video file) you're always going to be much more productive implementing the entire thing in C++.


> Unless that memory area holds just a simple data BLOB (like a video file) you're always going to be much more productive implementing the entire thing in C++.

Or use a GC enabled systems programming language, that provides control over what is allocated via GC or via other means.



You can even write c-like structs over byte-buffers - https://github.com/ztellman/vertigo





Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: