MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Mappoint 2006 memory Leak?

This is a discussion on Mappoint 2006 memory Leak? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am using mappoint as an embedded part of my app. I'm currently doing a lot of FindNearby and FindPlaces ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (2) Thread Tools Display Modes
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 11-06-2006
Junior Member
Yellow Belt
 
Join Date: Oct 2005
Posts: 27
Cool Mappoint 2006 memory Leak?

I am using mappoint as an embedded part of my app. I'm currently doing a lot of FindNearby and FindPlaces calls. Over a course of several hours, mappoint goes from have 10MB of memory to over 400MB. Is there a way to release these "find" results? It's really the only thing I'm doing other than GoTo location calls.

Steve
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 11-06-2006
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 248
Re: Mappoint 2006 memory Leak?

Steve,

Post your code, it's might be in there somewhere ...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 11-07-2006
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 899
Blog Entries: 10
Re: Mappoint 2006 memory Leak?

Yes, you need to clear/reference references to all MapPoint objects when you've finished with them.

After saying that, MapPoint does tend to grow over time when you're doing batch work (eg. lots of route finding). For "application" MapPoint, there's a minimise/maximise trick which forces the garbage collector to run.
An alternative is to stop it and restart it - this should also work for the control.


Richard
__________________
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 11-07-2006
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,480
Blog Entries: 1
Re: Mappoint 2006 memory Leak?

Quote:
Originally Posted by Winwaed View Post
For "application" MapPoint, there's a minimise/maximise trick which forces the garbage collector to run.
That is a nice trick, I will have to try it. I have always been closing and reopening it when I run into the problem of the MapPoint app growing into hundreds of MB and it slows down.

Eric
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 11-07-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Re: Mappoint 2006 memory Leak?

Hi Steve,

Quote:
10MB of memory to over 400MB. Is there a way to release these "find" results
do them in a separate object that you dispose once a while.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 11-08-2006
Junior Member
Yellow Belt
 
Join Date: Oct 2005
Posts: 27
Question Re: Mappoint 2006 memory Leak?

Quote:
Originally Posted by Winwaed View Post
Yes, you need to clear/reference references to all MapPoint objects when you've finished with them.

After saying that, MapPoint does tend to grow over time when you're doing batch work (eg. lots of route finding). For "application" MapPoint, there's a minimise/maximise trick which forces the garbage collector to run.
An alternative is to stop it and restart it - this should also work for the control.


Richard
Not sure how to "Clear/reference"... Any objects I create including "FindResults" are just declared on the stack during a member function, and thus are deleted when the function is complete. What exactly is the "minimise/maximise" trick? Are you saying that you show or hide the window? or are you maximizing the window? Wouldn't that be pretty ugly to the user?

Steve
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 11-09-2006
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 899
Blog Entries: 10
Re: Mappoint 2006 memory Leak?

Minimize/Maximize: Possibly, it depends on your application. Wilfried discovered it, so if you search the forums you'll find his solution. You have to send messages to MapPoint's window - the hide/show property isn't enough.

Objects usually end up on the heap and not the stack - this is an important difference between objects and value types (like integer).
MapPoint objects actually COM references.
I'm not sure what language you're using, but in VB 6 you will need to set each object reference to nothing when you've finished with it, eg:

set myPin = myMap.AddPushpin(....)
' (Do something interesting with myPin)
set myPin = Nothing


VB6 is then clever enough to delete the object when all references are removed.
In C++, you would use "Release()" on the object reference - and you have to be a little bit more careful with other references.


Richard
__________________
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 11-10-2006
Junior Member
Yellow Belt
 
Join Date: Oct 2005
Posts: 27
Re: Mappoint 2006 memory Leak?

Well, I am using C++, but can't call Release() (at least on the FindResults object), as it isn't part of the Class. So, not sure what you're referring to.

Steve
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 11-10-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Re: Mappoint 2006 memory Leak?

Hi,

This is a typical inter-application problem where no garbage collector can clean, unless it is in the object itself.

Consider this function:
Code:
FindResults results = map.ObjectsFromPoint(x, y);
It create a collection on the heap. When the function returns the address of the structure is in EAX register. the called application can and may not free this because the calling application need it.

So there is no method provided in the FindResults to free it (and I doupt if this is possilbe in COM factory) it will persist in memory forever until the server is destroyed.

So for 24/7 applications do these things in a separate object witch you once a while destroy.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 12-21-2006
Junior Member
Yellow Belt
 
Join Date: Oct 2005
Posts: 27
Re: Mappoint 2006 memory Leak?

What other calls besides this one does this?
FindResults results = map.ObjectsFromPoint(x, y);

I use FindResults all over the place. Good C++ practice is that it detroys itself when deconstructed, unless it has a Release, function which it does not. Are you telling me that there is no way to clean this up?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
leak, mappoint 2006, memory


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/mappoint-2006-memory-leak-5333.html

Posted By For Type Date
elfcorp's bookmarks on del.icio.us This thread Refback 01-21-2007 08:24 AM
elfcorp's bookmarks on del.icio.us This thread Refback 12-27-2006 09:32 AM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Memory leak - Bulk calculates bigderek MapPoint 2006/2009 Discussion 7 10-08-2008 07:50 AM
Memory leaks in MapPoint rbarthels MapPoint 2006/2009 Discussion 2 01-27-2004 05:53 PM
Mappoint and VB.NET: Horrible Memory Usage mrobold MapPoint 2006/2009 Discussion 2 11-12-2003 06:16 PM
memory leak with objloc.goto? mzupan MapPoint 2006/2009 Discussion 1 08-02-2003 01:14 AM
Huge memory leak in using QueryShape? random0000 MapPoint 2006/2009 Discussion 2 03-28-2003 06:22 AM


All times are GMT -5. The time now is 05:09 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54