Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 4 of 4

Garbage collection

This is a discussion on Garbage collection within the MapPoint Desktop 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 ...

  1. #1
    daxydoggie is offline 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!!!!!!

  2. #2
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    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

  3. #3
    daxydoggie is offline 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

  4. #4
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. garbage collection
    By SimonPearse in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 01-05-2007, 01:10 PM
  2. This forum is GARBAGE !!!
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 12-30-2004, 02:53 PM
  3. Garbage Anyone?
    By daxydoggie in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 11-22-2004, 11:16 AM
  4. requested member of collection does not exist
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 11-16-2004, 08:22 AM
  5. limiting objects in collection
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-27-2004, 08:52 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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