[DGD] LWO Behavior in mappings

Jay Shaffstall jshaffst at netwalk.com
Tue May 20 15:47:40 CEST 2003


I think I've figured out the reason behind my mappings getting too large 
problem.  I started counting scripts, and realized there weren't even close 
to 10,000 legitimate scripts to be put into the mapping.

The problem is that I was using a lightweight object as the index into the 
mapping, and these mapping entries were living beyond the end of the 
current thread.  Further, the mapping lived in a different object than the 
one that had the original reference to the lightweight object.  So at the 
end of the thread, the lightweight object in the mapping was copied.  In a 
later thread, I would check to see if the lightweight object existed in the 
mapping yet...since it had been copied, the answer was always no, and I 
would create a new entry for it, which created yet another copy at the end 
of the thread, etc.  Multiply this by a hundred lightweight objects, and 
you can reach 10,000 entries in a fairly small number of threads.

It seems that the moral is to not use lightweight objects as indices into 
mappings, except in limited circumstances.

Jay

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list