4 ms·
So the only place you really define what objects get created is in the class containing the main method? Seems fairly limited that you’d have to know upfront wh
by ako 4y ago
So the only place you really define what objects get created is in the class containing the main method? Seems fairly limited that you’d have to know upfront what your memory needs are? An app would have to allocate a large block of memory in the main class, and then handle memory management itself from this piece of memory?
- bullen 4y agoYes, you would have to overallocate and reuse. This is the way I code C now allready.
- ako 4y agoThat would remove a lot of the benefits of using Java, might as well use something like c. Garbage collection has been highly optimized in the jvm, and most would consider it a benefit of a jvm compared to managing memory yourself.
- the_only_law 4y agoI’ve never understood it either. I’ve heard people doing similar things with Java in the low-latency trading area. I mean Java isn’t the worst tool out there, but even C# outclasses it as a language. The biggest plus for Java is the massive, mature ecosystem which I imagine mostly evaporates when you’re only using a self restrictive subset of the language itself.
- kaba0 4y agoIt doesn’t evaporate, more often than not only a small subset of these trading programs need that strict “no heap allocation” policy. The rest of the program is free to take advantage of the huge ecosystem.
- invalidname 4y agoI have a bit of a different idea along somewhat different lines. Tweeted at you.