c# - Do I have a serious memory leak problem? -


i'm building windows form application in c# reads hundreds of file , create object hierarchy. in particular:

debug[14]: imported 129 system/s, 6450 query/s, 6284293 document/s. 

the sum total number of object i've created. objects simple way, int/string properties , typed lists inside.

question: normal application consuming 700mb of memory (in debug mode)? can how reduce memory usage?

edit: here why have 6284293 objects, if you're curious. imagine search engine, called "system". system have more queries inside it.

public class system {   public list<query> queries; } 

each query object refers "topic"; main argument (eg. search "italy weekend"). ha list of retrieved document inside:

public class query {   public topic topic; // maintain reference topic   public list<retrieveddocument> retrieveddocuments;   public system system; // maintain reference system } 

each retrieved document has score , rank , has reference topic document:

public class retrieveddocument {   public string id;   public int rank;   public double score;   public document document; } 

each topic has collection of documents inside, can relevant or not relevant, , reference parent topic:

public class topic {   public int id;   public list<document> documents;   public list<document> relevantdocuments   {     {return documents.where(d => d.isrelevant());}   } }  public class document {   public string id;   public bool isrelevant;   public topic topic; // maintain reference topic } 

there 129 systems, 50 main topics (129*50 = 6450 query objects), each query has different number of retrieved documents, 6284293 in total. need hierarchy doing calculations (average precision, topic ease, system mean average precision, relevancy). how trec works...

if you're reading 6284293 documents , holding on these in object hierarchy, application if going use fair amount of memory. hard if you're using more expected given don't know size of these objects.

also, remember clr allocates , frees memory on behalf of application. though application has released memory may not reflected on process' memory usage. if application not leaking memory reclaimed @ point, shouldn't expect see managed memory usage reflected in process memory usage clr may hold on memory reduce number of allocations/frees.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -