Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on Garbage collection within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I'm sure the MeyerMaster or FiendishFrost can help out here. MP2004-EURO, Memory usage Using VB6 for automation, and cant ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Garbage collection I'm sure the MeyerMaster or FiendishFrost can help out here. MP2004-EURO, Memory usage Using VB6 for automation, and cant seem to do anything that releeases any of the memory used by map point, apart from closing, but that isnt a realistic option. I have noticed though, that if you simply minimize the mappoint window with the mouse, the memory goes down from over 150M (in my example) to about 1.8/1.9M!!!!! Use the task manager to view this. I've tried minimizing the window using the mp object model (windowstate), but doesn't work, but click that minimize button and watch the garabge being collected!!! Does anyone know of this, will sedning the mappoint app window a windows message to minimize do the trick? Also, I notice that MP stores quite a lot of data in ech iof the cached forward/back screen shots and is probably contributing to using lots of memory to hold these pages, can the app be configured in any way to limit to say 3 most recent searches/views, ie 3 pages on the back button? Any other tips on making MP smaller most appreciated. Dont let me down dudes!!!!!! |
| ||||
|
That's useful to know. I know that "hiding" MapPoint doesn't force a garbage disposal. Have you made any speed measurements before and after? As MapPoint's memory grows/clogs, MapPoint's performance slows significantly. Try sending the message - it might work! Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools See the Geoweb Guru for online mapping |
| |||
| Eureka!!!!!!
Admins/Moderators, Does this one go "sticky" in the tech archives????? Re: Garbage collection, this does work, Calling MinMap does free up LOT AND LOTS of memory, in effect we are forcing windows to trim the working set of the map point app. Here I'm lloking for the hwnd of the mp app window, i have given it a different name, to integrate with my app, then simply send it a win msg that simulates the user clicking the minimize button on the window. NOTE: as stated earlier, programitically setting the widow to m,inimized DOES NOT WORK!!!! I call this routine periodically after the user moves from one breakdown job to another, and its keeps things fresh along the way! All I need do is programatically resize when user wants control again on the next job, OR you could just call this and a restore/maximize routine pertiodically at an appropriate application point. Use taskmanager and try this after using your map for a few minutes of serious zooming and navigation over say London/Paris or NY,LA etc, really crank up that memory usage before caling this! Private Sub MinMap() On Error GoTo EH_error Dim lHWnd As Long Dim lResult As Long lHWnd = FindWindow(vbNullString, "Map - Call Assist Vehicle Breakdown System") lResult = SendMessage(lHWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0) Exit Sub EH_error: Err.Raise Err.Number, vbCrLf & App.Title & ".frmMain.MinMap()." & Err.Source, Err.Description End Sub |
| ||||
|
I've just been trying this mechanism out in C++. I can confirm that the MapPoint API's minimise/maximise functionality will NOT force garbage collection. You must force a "user minimize" by sending messages. Also, you can't use this method with add-ins because they run "in thread". However, you can use it for external programs, and I've just added an option in GridImp to perform Garbage Collection every so often. This is the code that performs the deed: Code: void MapPointController::ForceGarbageCollection(const string& appName)
{
HWND lhWnd = FindWindow( NULL, appName.c_str() );
SendMessage( lhWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
SendMessage( lhWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
}
I think I've promised Eric an article on MapPoint efficiency, covering the topics of NP-completeness and garbage collection - so I'll cover it in more detail there. Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools See the Geoweb Guru for online mapping |
![]() |
| Tags |
| collection, garbage |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| garbage collection | SimonPearse | MapPoint 2006/2009 Discussion | 6 | 01-05-2007 12:10 PM |
| This forum is GARBAGE !!! | Anonymous | MapPoint 2006/2009 Discussion | 4 | 12-30-2004 01:53 PM |
| Garbage Anyone? | daxydoggie | MapPoint 2006/2009 Discussion | 0 | 11-22-2004 10:16 AM |
| requested member of collection does not exist | Anonymous | MapPoint 2006/2009 Discussion | 0 | 11-16-2004 07:22 AM |
| limiting objects in collection | Anonymous | MapPoint 2006/2009 Discussion | 0 | 04-27-2004 07:52 AM |
Luxor Holiday
Book your Luxor holiday through UlookUbook and visit this destination stooped in history.