[Routing] How to load OsmBinDataSet dataset to memory and reuse it during next sessions

Marcus Wolschon Marcus at Wolschon.biz
Fri Aug 27 20:14:34 BST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 27.08.2010 19:50, schrieb Oleg Demchenko:
> Dear all.
>
> I've imported country OSM file to OSM Binary format and more or
> less successfully finding a route using travelingsalesman class
> and osmbin as dataset. Performance is much faster than with XML
> (OSM file), but there are still some points for improvement.

OsmBin is outdated and replaced by H2DataSet.

> Well, each time when program call method like .getNearestNode(),
> I'm getting exception (warning)
>
> /org.openstreetmap.osm.data.osmbin.FixedRecordFile <init> INFO:
> Memory-maping the file failed in
> org.openstreetmap.osm.data.osmbin.IDIndex File - using
> conventional io instead/
>

That is okay and means that your file is larger then the Address-Range
you supply on
the Java-Command-Line for Memory-Mapped IO. So the file cannot be
mapped into memory
and is accessed using conventional IO.
That is about 10x slower for such random access then memory mapped IO.
Thus the strong warnings.

The recommed command-line for Sun Java is:
*java -XX:MaxDirectMemorySize=512M -jar traveling_salesman.jar*

(Documented in travelingsales.sourceforge.net under
"using Traveling Salesman"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx4DpoACgkQf1hPnk3Z0cSIXACeKDNQ91ZedZ9Uhm87/zVkNiHN
QhwAn2FE/fJnLeaYgsvv+5DnWX/oEEHG
=19wU
-----END PGP SIGNATURE-----

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/routing/attachments/20100827/9a02b3ca/attachment.html>


More information about the Routing mailing list