0

I'm using Graphhopper on my local to get driving direction between two latitude/longitude. Everything was fine and I was getting results in less than 100ms when I had loaded data for only one country. Now I've loaded the dataset to Asia and the result has became too slow (In some cases more than 10s). And now for some routes I'm getting this error:

ERROR com.graphhopper.http.GHErrorHandler - GC overhead limit exceeded, 
                java.lang.OutOfMemoryError: GC overhead limit exceeded

My goal is to load all of the world data and get results in less than 1 second. What performance optimization I can do to achieve this goal ? Currently I'm using a system with 8 GB RAM. I'm open to increase the RAM if required to optimize the performance.

Rahul
  • 3,208
  • 8
  • 38
  • 68
  • Which dataaccess setting do you have and how large is the created graphhopper folder (or post the full config.properties). Use this size +10% for the Xmx&Xms setting of the JVM. – Karussell Jul 13 '16 at 21:48
  • E.g. if you want fast results then you should **not** use the memory mapped settting (MMAP_SYNC_STORE) – Karussell Jul 13 '16 at 21:50
  • Hey thanks for the response. Increasing the Xmx&Xms does help. So approximately how much physical memory it will be required for working with the whole world data ? What's the recommended settings in this case ? – Rahul Jul 18 '16 at 11:02

1 Answers1

0

A "GC overhead limit exceeded" message means that the JVM is spending most of its time garbage collection. That usually means that the heap is close to full.

There are two ways to approach this:

  • You could increase the Java heap size. However, if you increase the heap size too much, you can end up using more virtual memory than you have physical RAM. That can push your system into a mode where the VM thrashes; i.e. it spends most of its time swapping pages between RAM and your swap device.

  • You could look for ways to reduce memory usage. Now I don't know what graphhopper is, but it sounds like it is an application that works by loading large graphs into memory. If that is the case, then it may be difficult to reduce memory usage ... without rewriting the application.

Ultimately, any application that loads large datasets into memory is going to have problems scaling beyond the amount of physical RAM that you have available.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • Currently this is my setting JAVA_OPTS=-Xmx4000m -Xms4000m -server. They have a demo server in which the same routes are coming in less than 1 second. Check this: https://graphhopper.com/maps/ . And when I try to run it on my server it's taking too long. Also, I've disabled swap. I'll try to check with diferrent heap size setting. – Rahul Jul 12 '16 at 08:27