From: Tim M. <tm...@un...> - 2012-01-25 09:00:46
|
Hi Leo, Thanks for looking into all of this. It is some useful analysis. I have tried to use the getAnns() method without creating new references to it. I violate this only to improve readability. I don't think it is causing to many problems though because the annotation lists persist in memory as long as the AST exists, so references to these lists elsewhere won't have much of an effect. One possibility to help with reducing the annotation list memory consumption is to modify the gnast code such that the annotation list for each term is initialised to null, and then only created the first time the getAnns() method is called. I'd wager that for a lot of terms, it is never called. And regarding your previous email, I definitely think a 2-3% increase in CPU use is a good trade off for halving memory usage. In the parser and typechecker, we can always wait a bit longer for the result, but once we're out of memory, there's nowhere to go! Cheers, Tim On 25/01/12 17:47, Leo Freitas wrote: > Hi guys, > > I think I found another source of some of the retained instances that seem to have weird behaviour. > > Term has a List<Object> getAnns() method, which exposes information like LocAnn and TypeAnn and others. > It's called in 1112 places across 17 CZT sub-projects: that exposes the ArrayList / Object[] for retention from those > that use the result or keep it in maps or the like. > > Having said that, I couldn't find a place of misuse in the scattered references that I searched for (e.g., this might > be just another red herring or a key point for modification/memory-performance-improvement)..... > > thoughts / comments / suggestions ? > > Leo > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > CZT-Devel mailing list > CZT...@li... > https://lists.sourceforge.net/lists/listinfo/czt-devel > |