4

I am trying to install nominatim using this guide. After one day of processing, I finaly get this message:

feature 895(k)
Killed

After a read in dmesg I got:

[143978.925793] Out of memory: kill process 14456 (bash) score 204947 or a child
[143978.925796] Killed process 15081 (nominatim) vsz:4871228kB, anon-rss:2953272kB, file-rss:0kB

Using osm2pgsl you can use the -s (slim) option but how can I process using NPI ?

How can I upgrade without restarting the whole process?

Caleb
  • 11,583
  • 4
  • 35
  • 49
Natim
  • 616
  • 1
  • 6
  • 16
  • What kind of RAM/other resources do you have on this system? – Caleb Apr 14 '11 at 08:12
  • It is a Intel i5 with 4GB of ram and 2GB of swap. – Natim Apr 14 '11 at 11:28
  • Swap should generally be at least twice the size of your RAM. Out of curiosity, is the system swapping? If so that will take a long time. Perhaps you can look through documentation to see if there is a way to limit the process to even less RAM usage / smaller operations so that it doesn't run into conflicts on your system (although it might take longer, it will take less time than swapping) – Caleb Apr 14 '11 at 11:33
  • Yes the system is swapping and when running out of swap space crashing. – Natim Apr 14 '11 at 11:36
  • Usually with 4GB of RAM I never use the swap it is why 2GB seamed enough. With osm2pgsl there is the -s option which helps to slim the memory usage but not yet with Nominatim Pre-Indexed Data – Natim Apr 14 '11 at 11:38
  • 1
    Having swap be less than your RAM size is a bad idea, because sometimes what will happen is it wants to flush out RAM to make way for a big job, then fetch it back later from swap. You need to at least fit your RAM into swap, and some spare space is nice. See my edited answer below. – Caleb Apr 14 '11 at 11:40
  • On line 106, I founds : `passthru($osm2pgsql.' -lsc -O gazetteer -C 10000 --hstore -d '.$aDSNInfo['database'].' '.$aCMDResult['osm-file']);` I will try with a lower -C – Natim Apr 14 '11 at 11:40
  • @Natim: Good idea. – Caleb Apr 14 '11 at 11:41
  • Actually the -C is only used to create the db and the functions. For nominatim I still get the same problem. I wish I had installed a LVM filesystem ... – Natim Apr 14 '11 at 12:12
  • You can grow your swap by putting it in a file somewhere instead of using a fixed swap partition. – Caleb Apr 14 '11 at 12:15
  • i used this to make a 16GB swap ‑ https://help.ubuntu.com/community/SwapFaq#line-53 – Natim Apr 14 '11 at 12:40

2 Answers2

2

I suspect you have an old version of nominatim that had a memory leak, this was fixed a few weeks back. Probably if you update the code from svn and rebuilt that will resolve the issue.

1

It sounds like the process scheduler or low memory killer is getting in your way. Your machine is likely under-powered for this job. You might try running this using nice with a higher priority than normal and making sure no extraneous things are running on the box, and don't do anything else that would try to use up memory while that is running. Hopefully when it gets through the initial process, the updates should be easier to deal with in the future.

Edit: Per discussion in comments, it looks like the job is crashing when it runs out of memory and then eats through the swap space. I recommend two things. First, increase the swap space. It should be at least 2x the size of your RAM, but going 10x isn't going to hurt. Second, try not to swap at all because it's going to be slower than drying mud. Figure out if there are ways to limit the process to working on smaller chunks at a time so that RAM is not used up.

Caleb
  • 11,583
  • 4
  • 35
  • 49
  • The process is taking 2 days or more so I still have to use my computer at the same time. – Natim Apr 14 '11 at 11:28