There are no destructors in Java object, when there are no more references
to an object Java's garbage collector will free the memory when it gets
around to it.  The garbage collector isn't running constantly, because it
would take too much resources and defeat the purpose.  There are a couple
things you can do to make the garbage collection process more efficient.

One thing you can do in your java code is to set all object references to
null when you are done using them, this saves the garbage collector for
having to see if there are references.

Another thing you can do is play with some of the JVM settings, you can
change the garbage collection strategy that the JVM will use, which may
improve performance in your case.

Another thing you can try is moving to a java CFX tag.

+++++++++++++++++++++++++++++++++++++++++++++
Pete Freitag ([EMAIL PROTECTED])
CTO, CFDEV.COM
ColdFusion Developer Resources
http://www.cfdev.com/


-----Original Message-----
From: Kinley Pon [mailto:[EMAIL PROTECTED]]
Sent: Sunday, November 25, 2001 11:48 AM
To: CF-Talk
Subject: Java and Coldfusion 4.5 using memory


A question for those java - Coldfusion experts:

When an object is instantiated with the statement

<cfset pointToThisObject=objectName.methodName()>,

the 'pointToThisObject' contains only the pointer address to the
instantiated object in memory.

It appears that Coldfusion is not releasing the memory space and leaving a
"vague" reference to the java object.  Being that this may be the case, the
memory is strinking which is causing a 'java.lang.OutOfMemoryError' to
occur.  The java memory space is strinking when multiple users (client
workstations) are using the application.

Is there a way to destroy or release this memory space?  I have tried <cfset
pointToThisObject = ""> but it only clears the pointer but not the memory
space.

Also, would you know how to determine what the memory usage would be within
Coldfusion during the before and after an object is instantiated?

Please help...I would hope that Coldfusion would be able to handle its own
garbage collection when referencing java objects.

talk soon - Kinley



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to