Release memory of an Object

Hi,

I am working with java, in my business logic i had to create many objects by using

'new' keyword, because of this i am getting " out of memory error : java heap space ",

this is coming because java heap space is getting full with these objects, so Can any

one tell me how can i release object's memory space manually with out default java

garbage collector.

[403 byte] By [mymessagesa] at [2007-11-26 15:55:34]
# 1
You don't need to release anything yourself. But you don't have to hold them. Do you add these objects in collections or have them referenced by other living and reachable objects in some other way?Mike
bellyrippera at 2007-7-8 22:16:18 > top of Java-index,Java Essentials,Java Programming...
# 2

I happen to chance upon this thread, otherwise I would have posted a new one.

I'm sure manual release of memory resources is not necessary when Java GC does all the job. But for the sake of keeping them optimized and "clean", is it advisable to null such objects after every use?

Say like this...

Vector<String> obj = new Vector<String>();

// (do some work)

obj.clear();

obj = null;

weihza at 2007-7-8 22:16:18 > top of Java-index,Java Essentials,Java Programming...
# 3
> advisable to null such objects after every use?Do you understand concepts like "variable scope"? No, it's not necessary in 99.99% of all cases. The ones where it *theoretically* might be are related to objects keeping a big amount of stuff in their attributes they could
CeciNEstPasUnProgrammeura at 2007-7-8 22:16:18 > top of Java-index,Java Essentials,Java Programming...
# 4
Thank you for your advice.
weihza at 2007-7-8 22:16:18 > top of Java-index,Java Essentials,Java Programming...
# 5
Yes, i got it, Thanks for your advice.
mymessagesa at 2007-7-8 22:16:18 > top of Java-index,Java Essentials,Java Programming...