Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Steve |
| |||
| Re: Mappoint 2006 memory Leak?
Steve, Post your code, it's might be in there somewhere ... |
| ||||
| 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 |
| |||
| Re: Mappoint 2006 memory Leak?
Hi Steve, Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Quote:
Steve |
| ||||
| 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 |
| |||
| 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); 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.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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? |
![]() |
| Tags |
| leak, mappoint 2006, memory |
| ||||
| 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 | |
| |
| ||||
| 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 |