On torsdag, juli 25, 2002, at 10:51 , Benjamin Goldberg wrote:
> From: Benjamin Goldberg <[EMAIL PROTECTED]> > Date: tor jul 25, 2002 10:51:07 Europe/Stockholm > To: Elizabeth Mattijsen <[EMAIL PROTECTED]> > Cc: Arthur Bergman <[EMAIL PROTECTED]>, Dave Mitchell > <[EMAIL PROTECTED]>, [EMAIL PROTECTED], [EMAIL PROTECTED] > Subject: Re: more memory benchmarks > > Elizabeth Mattijsen wrote: >> >> At 09:18 AM 7/25/02 +0200, Arthur Bergman wrote: >>>> Each shared var has an emptyish SV per thread which has attached >>>> magic that allows it to access the contents of the real var. >>> For a large amount of data :shared will save you memory, the overhead >>> of the magic is rather small compared to large data structures :) >> >> Eh... that's what you might think, but my observations (I wouldn't >> call them benchmarks) tell me otherwise... ;-( > > When the interpreter is cloned, does the *data* in a shared variable get > copied? If so, then clearly that's you're problem right there. > > The shared variable would, in the new thread, have a complete copy of > the data that was in the original variable, plus a bit of magic which > says to ignore that copy, but use the data in the original. The copied > data would be unused and and the memory wasted. > > I'm not sure how to check for this being the case, though. > > -- Yes I suspect this is the case. Arthur
