Page 1 of 1

Out of memory exceptions

PostPosted: Sat Jan 07, 2023 11:49 pm
by lebdron
Hello. Recently I started getting the following messages in the log, presumably leading to a system hang:
  Code:
Jan  5 02:22:30 raspberrypi serviio.sh[162193]: [2426886.643s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 2048k, guardsize: 0k, detached.
Jan  5 02:22:30 raspberrypi serviio.sh[162193]: [2426886.739s][warning][os,thread] Failed to start the native thread for java.lang.Thread "ServioThread-73951-DiscoveryNotifier"
Jan  5 02:22:30 raspberrypi kernel: [2456326.637800] cgroup: fork rejected by pids controller in /system.slice/serviio.service
Jan  5 02:22:30 raspberrypi serviio.sh[162193]: Exception in thread "ServioThread-72352-DiscoverySSDPMessageListener" java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached
Jan  5 02:22:30 raspberrypi serviio.sh[162193]: #011at java.base/java.lang.Thread.start0(Native Method)
Jan  5 02:22:30 raspberrypi serviio.sh[162193]: #011at java.base/java.lang.Thread.start(Thread.java:798)
Jan  5 02:22:30 raspberrypi serviio.sh[162193]: #011at org.serviio.upnp.discovery.DiscoveryManager.deviceAvailable(DiscoveryManager.java:134)
Jan  5 02:22:30 raspberrypi serviio.sh[162193]: #011at org.serviio.upnp.discovery.DiscoveryManager.restartDiscoveryEngine(DiscoveryManager.java:109)
Jan  5 02:22:30 raspberrypi serviio.sh[162193]: #011at org.serviio.upnp.discovery.Multicaster.getBoundNIC(Multicaster.java:46)
Jan  5 02:22:30 raspberrypi serviio.sh[162193]: #011at org.serviio.upnp.discovery.DiscoverySSDPMessageListener.run(DiscoverySSDPMessageListener.java:81)
Jan  5 02:22:30 raspberrypi serviio.sh[162193]: #011at java.base/java.lang.Thread.run(Thread.java:829)
Jan  5 02:23:55 raspberrypi serviio.sh[162193]: [2426971.829s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 2048k, guardsize: 0k, detached.
Jan  5 02:23:55 raspberrypi serviio.sh[162193]: [2426971.833s][warning][os,thread] Failed to start the native thread for java.lang.Thread "ServioThread-73955-DiscoveryNotifier"
Jan  5 02:23:55 raspberrypi serviio.sh[162193]: Exception in thread "ServioThread-73948-DiscoverySSDPMessageListener" java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached
Jan  5 02:23:55 raspberrypi serviio.sh[162193]: #011at java.base/java.lang.Thread.start0(Native Method)
Jan  5 02:23:55 raspberrypi serviio.sh[162193]: #011at java.base/java.lang.Thread.start(Thread.java:798)
Jan  5 02:23:55 raspberrypi serviio.sh[162193]: #011at org.serviio.upnp.discovery.DiscoveryManager.deviceAvailable(DiscoveryManager.java:134)
Jan  5 02:23:55 raspberrypi serviio.sh[162193]: #011at org.serviio.upnp.discovery.DiscoveryManager.restartDiscoveryEngine(DiscoveryManager.java:109)
Jan  5 02:23:55 raspberrypi serviio.sh[162193]: #011at org.serviio.upnp.discovery.Multicaster.getBoundNIC(Multicaster.java:46)
Jan  5 02:23:55 raspberrypi serviio.sh[162193]: #011at org.serviio.upnp.discovery.DiscoverySSDPMessageListener.run(DiscoverySSDPMessageListener.java:81)
Jan  5 02:23:55 raspberrypi serviio.sh[162193]: #011at java.base/java.lang.Thread.run(Thread.java:829)

Is there anything I can do with it? Thank you.

Re: Out of memory exceptions

PostPosted: Sun Jan 08, 2023 3:32 am
by atc98092
You can increase the memory assigned to Java in the VMOptions file. I can't say where that file is located on your install, since you're not using Windows. Unfortunately, I can't recall the format of the command to add to the line. I thought I had it in my folder, but I just checked and it's not there.

Wait, I think I found it. Add -Xmx512m to the file I mentioned above. If 512m isn't enough, bump it to 1024m and try again. Make sure you restart the Serviio service after you make the change.

Re: Out of memory exceptions

PostPosted: Sun Jan 08, 2023 6:28 pm
by cmakula
The JVM options are located at the end of the serviio.sh file in the bin directory of the Linux/RasPi install. You can set the -Xmx512M options there.

Good Luck