From: Ard-Jan G. - C. T. E. - S. S. <Ardjan.Glas@Sun.COM> - 2002-04-11 15:06:50
|
There is a design pattern "flyweight", that gives a solution to handling multiple objects with limited resource available. It's in the book design patterns by Enrich Gamma ISBN 0-201-63361-2 >From: "Techentin, Robert W." <tec...@ma...> >To: Inc...@li... >Cc: cra...@al... >Subject: RE: [Incrtcl-users] incrTcl objects memory useage >MIME-Version: 1.0 >X-BeenThere: inc...@li... >X-Mailman-Version: 2.0.9-sf.net >List-Help: <mailto:inc...@li...?subject=help> >List-Post: <mailto:inc...@li...> >List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/incrtcl-users>, <mailto:inc...@li...?subject=subscribe> >List-Id: <incrtcl-users.lists.sourceforge.net> >List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/incrtcl-users>, <mailto:inc...@li...?subject=unsubscribe> >List-Archive: <http://www.geocrawler.com/redir-sf.php3?list=incrtcl-users> >X-Original-Date: Thu, 11 Apr 2002 09:46:41 -0500 >Date: Thu, 11 Apr 2002 09:46:41 -0500 > > >> I was wondering if anyone out there has done any sort of >> investigation on how much memory incrTcl objects use up. The >> reason I am asking is that we are developing a system that >> uses a LOT of objects, and we want to know if there are some >> ways of designing our classes to cut down on some of the >> memory requirements (of course at the same time we don't >> want to just throw away any of the useful OO concepts). Some of the >> info I am looking for: >> >> - how much memory does an empty object use? Is this system >> dependant? >> >> - does inheritence of a class increase object size by the >> size of the inherited class, or is there some overhead >> involved, or is the inheritiance process optimized somehow?. >> - how much memory do methods use up? Is this per class or >> per object? >> >> - do properties use up memory apart from the data they are storing >> (overhead) > > >Some of this you can glean from "Memory costs with Tcl" at >http://mini.net/tcl/1617.html > >For the Incr Tcl specific stuff, I'd suggest making some measurements. You >can recompile with the TCL_MEMORY_DEBUG flag, as shown on the wiki page, or >just use a system memory display and create lots and lots and lots of >objects. > >My guesses are that object memory use is probably constant across 32 bit >machines, and that inheritance and methods would increase memory consumption >on a per-class basis, but not on a per-object basis. Properties >(variables), on the other hand, should increase memory consumption on a >per-object basis, probably pretty much as described on the wiki page. > >Bob >-- >Bob Techentin tec...@ma... >Mayo Foundation (507) 538-5495 >200 First St. SW FAX (507) 284-9171 >Rochester MN, 55901 USA http://www.mayo.edu/sppdg/ > > >_______________________________________________ >Incrtcl-users mailing list >Inc...@li... >https://lists.sourceforge.net/lists/listinfo/incrtcl-users |