Skip to content
Tcl Source Code Artifact [2dfaab0320]
Login

Artifact [2dfaab0320]

Artifact 2dfaab0320ab398cccefc6377330ddb1855c644e:

Ticket change [2dfaab0320] - Ticket [2960042fffffffff|2960042fff] <i>high water mark memory not shared for file I/O needs</i> status still Open with 4 other changes by dkf on 2010-03-04 17:16:50.
D 2010-03-04T17:16:50
J icomment Doing\sGC\sis...\swell,\snot\sa\ssmall\sproject.\sBest\smake\sit\sout\sof\sscope\sfor\sour\sown\ssanity.\s:-)\n\nMy\soriginal\scode\s(now\srather\sbitrotted,\seven\sif\sI\scan\sfind\sa\scopy\swhich\smay\sbe\simpossible)\sfor\sdoing\sthis\shad\sa\sscheme\sfor\sgetting\smemory\spages\sdirectly\sfrom\sthe\sOS\s(every\smodern\sOS\scan\sdo\sthat)\swhich\sI'd\sthen\sput\sa\sheader\sstructure\sat\sthe\sstart\sof\sthe\spage\sand\sfill\sthe\srest\sof\sthe\spage\swith\s(initially\sunused)\sTcl_Obj\sstructures.\sI'd\sthen\sdo\ssome\sevil\sbit\sbashing\sto\sgo\sfrom\sthe\saddress\sof\sa\sTcl_Obj\sto\sthe\saddress\sof\sthe\spage\scontaining\sit\s(using\sthe\sobvious\sfact\sthat\sthe\spage\sis\saligned\son\sa\spage\sboundary)\sso\sthat\sI\scould\scheaply\sget\sthe\saccounting\sstructure.\sOverall,\sI'd\sthrow\saway\spages\sback\sto\sthe\sOS\s(possible\ssince\sI'd\sgot\sthem\sallocated\sdirectly\sinstead\sof\svia\smalloc)\swhen\sa\spage\shad\sno\sin-use\sobjects\son\sit;\sI'd\skeep\saround\sone\sspare\spage\son\sdeallocation\sso\sthat\sthere\swouldn't\sbe\sdisastrous\sperformance\seffects\sif\sthere\swere\sallocations\sback\sand\sforth\sacross\sa\spage\sboundary.\n\nThe\sreason\swhy\sthis\sstrategy\susually\sworks?\sIt\sdepends\son\sthe\sfact\sthat\smost\sapps\shave\sa\sgroup\sof\sobjects\sthat\shave\slong\slifetimes\sand\smany\sothers\sthat\shave\sshort\slifetimes;\seven\sthough\sthere\swill\sbe\ssome\spages\slocked\sdown\sbecause\sof\sthe\slong\slifetimes,\sthere\swill\sbe\smany\sothers\sthat\sare\sable\sto\sbe\sfreed.\sGenerational\sgarbage\scollectors\suse\sthe\ssame\sset\sof\sbasic\sunderlying\sassumptions\sabout\sthe\spopulation\sof\sobject\slifetimes,\sand\sthey\sseem\sto\swork\sreally\swell\sin\spractice.\n\nThe\smain\sproblem\sis\sjust\sone\sof\sengineering.\sGetting\sit\sall\sto\swork\sreally\sstably\sacross\smany\splatforms\sis\squite\schallenging\s(at\sthe\stime\sI\swas\sworking\son\sthis,\sI\shad\sthe\sadvantage\sof\sonly\sneeding\sit\sto\swork\son\s32-bit\sSPARC\srunning\sSolaris).\n
J login dkf
J mimetype text/plain
J username dkf
K 2960042fffffffffffffffffffffffffffffffff
U dkf
Z ed33355f167858820158bfca173cd598