3 ms·
There is no need, nor even a way, to "micromanage Java's garbage collector". Once the heap size approaches the limit, GC runs and it will free what can be freed
by thomas11 16y ago
There is no need, nor even a way, to "micromanage Java's garbage collector". Once the heap size approaches the limit, GC runs and it will free what can be freed. So as long as you design your data structures in a way so that they don't hold on to objects you don't need anymore, you should be fine.
Of course, in C(++) you can design much more memory-efficient data structures through pointer arithmetic. But that's independent of GC.
- vlisivka 16y agoMicromanagement of GC is possible using Soft/Weak/Phantom references, see http://weblogs.java.net/blog/2006/05/04/understanding-weak-references http://weblogs.java.net/blog/2006/05/04/understanding-weak-r... . > Of course, in C(++) you can design much more memory-efficient data structures through pointer arithmetic. Yeah, you can reinvent the wheel in C++, C or even in ASM.