Sammy -

I've got a pretty good idea what's going on.

Basically I have one set of SoftReferences being used on the ColdFusion
Classpath, and another set pointing to the same objects being used in some
custom Java loaded via JavaLoader (so via a URLClassLoader).

Since they are on seperate ClassLoaders, I would doubt that the JVM can
traverse from the CF ClassLoader -> URLClassLoader to see what strong
references are around.  Which explains the behaviour I'm getting.

So I'm re-architecting my code so that there is only ever one soft reference
for an object in the system, and that is created when required, and then
used across the board, and only one ReferenceQueue that is used to manage
when it is clear() ed by the garbage collector.

But thanks for you help! :oD

Mark

On 2/15/07, Sammy Larbi <[EMAIL PROTECTED]> wrote:

Mark,

That /is/ strange.  I just read the docs on it, and it does mention
specifically "At that time [the garbage collector] may choose to clear
atomically all soft references to that object."

Certainly atomically means all both references should be collected.

But, you probably already knew that =).

Can you share how you are (re)producing the behavior?

-Sam


Mark Mandel wrote, On 2/14/2007 7:45 PM:
> Hey all,
>
> I'm wondering if anyone has seen behaiviour where you have 2
> SoftReference objects pointing to the same CFC, and one soft reference
> will get picked up by the JVM and garbage collected, but the other one
> won't?
>
> It's doesn't seem like it should be possible, but it seems to be
> happening to me.
>
> Any thoughts?
>
> Mark
>



You are subscribed to cfcdev. To unsubscribe, please follow the
instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]




--
E: [EMAIL PROTECTED]
W: www.compoundtheory.com


You are subscribed to cfcdev. To unsubscribe, please follow the instructions at 
http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]

Reply via email to