Navit memory leak

vancel35 vancel at thespazcat.com
Fri Jan 29 19:16:19 CET 2010


I recently did an opkg update / upgrade, and a new version of Navit was
installed.  I am a new user to Navit, so I have it turned on even when I
know where I'm going to learn how its routing engine works in practice...
and because new programs are fun. :)

Since I've been taking the same route every day, I know Navit with my
current configuration should be able to handle my daily commute.  However,
after the update, Navit seems to have a SEVERE memory leak.

I tested my theory by running an ssh session from my desktop and running
htop within it.  I started Navit and let it sit for a few minutes to watch
memory.  On start it was using about 10% of my total RAM, and it didn't
change for several minutes.  My FR had 79MB in use before Navit start and
82MB in use after Navit start.

I suspected that it had to do with a malloc() call to render part of the map
without freeing the memory that is now off-screen, and that appears to be
the problem.  I tested it by dragging the map and letting it redraw that
part of the screen, and each time, Navit consumed more RAM.  After dragging
the map for only 1/2 of my commute distance, Navit has increased RAM usage
to 17%, and my total memory is now at 92MB used.

I'm sure the memory fills more quickly when I'm driving, because I have
auto-zoom enabled, so it's getting multiple zoom levels in memory for the
same map area.

Is this a known issue?  For such a short trip (13 miles / ~20Km), I wouldn't
expect such a severe memory leak.

The only configuration items I've changed from default is that I enabled
autozoom.  Other changes were after this memory leak appeared in attempts to
make it stop such as downloading different size map regions from OSM (city
level, region, state).

An interesting note is that as I've been sitting here typing this email
(about 15 minutes), it's slowly been releasing memory.  Releasing it at such
a slow pace seems silly when I'm using the "car" configuration.  I'd
actually rather have it not try to cache those rendered sections and just
re-render if I return to the area.

Hopefully I've given enough information to be useful in debugging.

-Laura

-- 
View this message in context: http://n2.nabble.com/Navit-memory-leak-tp4481548p4481548.html
Sent from the Openmoko Community mailing list archive at Nabble.com.



More information about the community mailing list