This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
speeding up opencpn
#1
i have noticed for a while that my opencpn was laggy when scrolling or zooming/ unzooming.
my system is a rpi5 with 8gb of memory, MacArthur hat and pci base for ssd drive.
well after a little digging i realized opencpn was being very conservative with my map cache and memory. 
i changed the follow in opencpn.config
 [settings]
GPUMemorySize=2048
MEMCacheLimit=4096
NCacheLimit=200
i don't know if the GPU setting is necessary but i added it anyway..
the change was rather dramatic and has fixed the issue. Big Grin
Reply
#2
after thinking about this i suspect the biggest boost was

GPUMemorySize=2048 not really necessary as rpi5 allocates video memory from system memory
MEMCacheLimit=4096 default half of memory
NCacheLimit=200 default 20

i should test this without the first 2 values. please feel free to test this and post what you find..
Reply
#3
Interestingly I do not have any of those in my config file.

And zooming/panning is laggy, especially when I am in the boat with all the inputs working. When playing in my lab without N2K and pypilot, all is quick.

As an additional note I have noticed, that when I do something "more", like trying to open AIS information of a vessel or opening the OpenCPN settings, some resources are not available as the opencpn seems to lose e.g. heading and it starts to point in random directions. When the AIS window is open all is well and the display calms down. I have only SignalK as my source for the data.
Reply
#4
I am also curious that you might try opencpn 4.x versions to compare as I believe there are not only regressions in performance but also stability (crashes) in the 5.x versions
Reply
#5
(2026-08-30, 03:27 AM)seandepagnier Wrote: I am also curious that you might try opencpn 4.x versions to compare as I believe there are not only regressions in performance but also stability (crashes) in the 5.x versions

My OpenCPN crashes everytime I use it for more than a few hours (and usually less than that). Version 5.12.4. I also have rpi5+SSD+MacArthur.
Reply
#6
(2026-09-05, 10:43 AM)Sully Wrote:
(2026-08-30, 03:27 AM)seandepagnier Wrote: I am also curious that you might try opencpn 4.x versions to compare as I believe there are not only regressions in performance but also stability (crashes) in the 5.x versions

My OpenCPN crashes everytime I use it for more than a few hours (and usually less than that). Version 5.12.4. I also have rpi5+SSD+MacArthur.

Something sounds  wrong in there, 5.14 my Pi5 runs for weeks at a time never turned off. Claude code wrote some monitoring code which runs in the background & sounds alarms if anything goes down, that flagged up   one outdated library which was leaking memory, I'll have a dig later on & see what it was. Htop can help a lot to flag up cpu & memory problems along the way. But it is rock solid on a Pi5, sounds like something amiss under the hood. 
   
Reply
#7
"My OpenCPN crashes everytime I use it for more than a few hours (and usually less than that). Version 5.12.4. I also have rpi5+SSD+MacArthur."

Here's a couple of commands might flag up something useful, on my system xorg nibbles away at swap memory, I just restart the desktop once a week or prob a little less (sudo systemctl restart lightdm) , closes open apps but only takes a minute or so to be up and running again.

Worth copy/paste the output of these into https://www.perplexity.ai/projects/4ac96...0093151532 (search, not computer) & see what it has to say, might find some smoking gun as to why your Opencpn isn't stable, it should be. 

Code:
for pid in $(ls /proc | grep -E '^[0-9]+$'); do
  swap=$(awk '/VmSwap/{print $2}' /proc/$pid/status 2>/dev/null)
  if [ -n "$swap" ] && [ "$swap" -gt 0 ]; then
    name=$(cat /proc/$pid/comm 2>/dev/null)
    echo "$swap $name (pid $pid)"
  fi
done | sort -rn | head -20

Code:
free -h
echo ---
swapon --show
echo ---
ps aux --sort=-%mem | head -15
Reply
#8
(2026-09-07, 07:34 AM)PaddyB Wrote: "My OpenCPN crashes everytime I use it for more than a few hours (and usually less than that). Version 5.12.4. I also have rpi5+SSD+MacArthur."

Here's a couple of commands might flag up something useful, on my system xorg nibbles away at swap memory, I just restart the desktop once a week or prob a little less (sudo systemctl restart lightdm) , closes open apps but only takes a minute or so to be up and running again.

Worth copy/paste the output of these into https://www.perplexity.ai/projects/4ac96...0093151532 (search, not computer) & see what it has to say, might find some smoking gun as to why your Opencpn isn't stable, it should be. 

Code:
for pid in $(ls /proc | grep -E '^[0-9]+$'); do
  swap=$(awk '/VmSwap/{print $2}' /proc/$pid/status 2>/dev/null)
  if [ -n "$swap" ] && [ "$swap" -gt 0 ]; then
    name=$(cat /proc/$pid/comm 2>/dev/null)
    echo "$swap $name (pid $pid)"
  fi
done | sort -rn | head -20

Code:
free -h
echo ---
swapon --show
echo ---
ps aux --sort=-%mem | head -15


For the crash itself, also collect immediately afterwards:

Code:
coredumpctl info opencpn
tail -200 ~/.opencpn/opencpn.log
journalctl -b --no-pager | grep -Ei 'oom|killed process|segfault|gpu|drm|vc4|i/o error'
vcgencmd get_throttled
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)