Re:I think I figured out why good Java developers are so har...
by thomas11 on Thursday October 14, 2010 @03:10AM
(#1790116)
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.
Re:I think I figured out why good Java developers are so har...
by vlisivka on Thursday October 14, 2010 @03:58AM
(#1790187)
Micromanagement of GC is possible using Soft/Weak/Phantom references, see 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.
Re:I think I figured out why good Java developers are so har...
by pvg on Thursday October 14, 2010 @04:07AM
(#1790202)
naturally blew the stack.
You mean the heap, right? The GC isn't going to help you with running out of stack. And the solution is usually to tell java to increase the default max heap limit.
1. Learn how to micromanage Java's garbage collector so it actually freed images I'm done with...
2. Use a language that manages memory directly: http://github.com/lukeschlather/ImageWeave
For less ambitious projects, I use PHP (if off-the-shelf solutions exist) and Python (if I need to build it.)