ThinkGeo.com    |     Documentation    |     Premium Support

IIS6/7 Mapsuite memory keeps increasing

Hi,


I created my own custom layer that generates bitmap and display it using Mapsuite.


Using the examples here, gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/12/aft/4200/afv/topic/Default.aspx


I noticed that, while the bitmap images are being drawn, IIS memory sky-rocketed.


I am wondering if Mapsuite is doing any cleanup ?


like forcing the garbage collector to release unused memory.


After it gets to a certain level (600mb Private memory usage). Mapsuite crashed.


Thanks.



Hello. 
  
 Not sure if the Mapsuite’s team see this thread.




















Hi Mapsuitedev,


 


It seems some unmanaged resource or local resources are not cleaned up in your class, in the subclass, we disposed the bitmap and graphic object after using it. I guess it’s the main reason of your issue. Could you check whether the bitmap, graphic or file object are disposed? If yes, please provide us your class by sending it to support@thinkgeo.com and ask to forward to Howard.


 


Any questions please let me know.


 


Thanks,


 


Howard



 



Hi Howard, 
  
 Yes, I am disposing like the examples suggested.  
  
 For some strange reason, I have to force the garbage collector to release unused memory. 
  
 If I didn’t do that, the memory will keep rising. 
  
 Not sure if that’s it.

Hi MapsuiteDev, 
  
 I was wondering that if you force the GC to release unused memory, how is the memory usage, it goes up or down? If it’s down, that’s what I expected, because it’s not memory leak.  
  
 You can often find a .NET application consumes more memory than others. That’s because the memory of an object will not be finalized and retrieved until there is a pressure on the memory. That is to say from the task manager, the memory will keep climbing higher and higher and suddenly when hitting some threshold, going back down. 
  
 In fact, it’s more efficient to let the .NET framework manage the memory itself. Although the memory keeps climbing up, program will not be crashed as always it will be retrieve at a right time. 
  
 I double checked the source code, and can’t find any code to force the GC to release the unused memory, could you send us your custom layer class and it’ll be more efficiency to find the reason. 
  
 Any questions please let me know, 
  
 Thanks 
  
 Howard 


I was wondering that if you force the GC to release unused memory, how is the memory usage, it goes up or down? If it’s down, that’s what I expected, because it’s not memory leak 
  
 The memory usage goes down. I double-check everything and dispose all the bitmap object created. 
 Yes, I will send it through later.

Hi MapsuiteDiv, 
  
 I’m looking forward to your class and then we can test it. 
  
 Thanks, 
  
 Howard