MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Garbage collection

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 ...


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 Thread Tools Display Modes
  #1 (permalink)  
Old 11-22-2004
Junior Member
Yellow Belt
 
Join Date: Aug 2003
Posts: 12
Garbage collection

Hi,

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!!!!!!
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-22-2004
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 848
Blog Entries: 7
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
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
  #3 (permalink)  
Old 11-22-2004
Junior Member
Yellow Belt
 
Join Date: Aug 2003
Posts: 12
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
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 05-04-2005
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 848
Blog Entries: 7
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);
}
The appName parameter holds the window name. I create this from the MapPoint edition and the file that has been loaded (="Map" if a new file).

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
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
Reply

Tags
collection, garbage


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
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


All times are GMT -5. The time now is 01:41 AM.


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

Cheap flights Lanzarote
Lanzarote has plenty of sunshine and plenty of sand. The only piece missing is you! Holiday Hypermarket books cheap flights to Lanzarote.

Late Deal Holidays
Whatever your travel needs, city breaks, late deal holidays, luxury holidays or family holidays - your personal Travel Counsellor can help

Holiday Jamaica
What springs to mind when you hear the word Jamaica? Bob Marley and Rum? Think again. Book a low cost holiday in Jamaica to explore this island for yourself.

Holidays to Bahamas
Choose from a number of extraordinary holidays to the Bahamas at The Holiday Place. See pictures of these beautiful islands online.

Cheap Holidays
Hunting for cheap holidays? Well save time by booking online with ulookubook.com and you can even check out our top tips to help you hunt down a bargain holiday.

Package Holidays
With the help of Travel.co.uk you can find the package holidays of your dreams.

Cheap Goa Holidays
Experience the world famous Wednesday Flea Market at Anjuna! Book cheap Goa holidays at On The Beach!


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