![]() |
|
Java memory/version issue [edited]. - Printable Version +- MinimServer Forum (https://forum.minimserver.com) +-- Forum: MinimServer (/forumdisplay.php?fid=1) +--- Forum: Support (/forumdisplay.php?fid=4) +--- Thread: Java memory/version issue [edited]. (/showthread.php?tid=7182) |
Java memory/version issue [edited]. - MarmiteSandwich - 01-03-2024 11:32 I have a Raspberry Pi which is exhibiting periodic memory problems. Over time, memory seems to be getting used up. See memory usage chart. Experimenting with top over a period of 9 days indicated that 2 java applications, MS and BubbleUPnP Server, were the culprits, although MS was worse.[attachment=3115] I use OpenMediaVault to manage the server and I have recently upgraded to OMV6. In the process, java seems to have been upgraded to 11. Code: pi@raspifaircross:~ $ java -versionIs there an issue with the version of Java, or is there some Java setting needed to prevent these memory usage chracteristics? Marmite Edit: correct memory usage chart added[attachment=3116] RE: Java memory/version issue [edited]. - simoncn - 02-03-2024 18:08 Thanks for letting me know about this. Please try adding resourceInfo=10000 to the serverOptions property and restarting MinimServer. With this setting, you will see periodic entries in the MinimServer log looking like this: 16:55:54.627 Thread-6: resourceInfo: browse request after 4764145 ms 16:55:54.646 Thread-6: resourceInfo: heap bytes used 7054000, consumed 18646264, committed 110100480, max 267911168 16:55:54.646 Thread-6: resourceInfo: non-heap bytes used 33044576, committed 34471936, max 1325400063 The important figures are heap bytes consumed and heap bytes used. If the heap bytes used value grows steadily over time, there is a memory leak in MinimServer or Java. If you can confirm from this that there is a memory leak when running on OpenJDK 11, I will investigate further. Please save the MinimServer log files that show this. RE: Java memory/version issue [edited]. - MarmiteSandwich - 02-03-2024 18:35 (02-03-2024 18:08)simoncn Wrote: Please try adding resourceInfo=10000 to the serverOptions property and restarting MinimServer. will do RE: Java memory/version issue [edited]. - bubbleguuum - 03-03-2024 16:14 Some years ago, with an older OpenJDK 11 version running on Ubuntu, I had observed a bug where worker threads in thread pools would not be reclaimed, inflating memory up to running out of it. I had to revert to Java 8 then (There was no newer than Java 11). But it was a long time ago and I doubt OpenJDK 11 still has this issue (which may have been specific to that Ubuntu build). Other than that, you can try newer OpenJDK 17 if available. The Eclipse OpenJ9 JVM is also great on memory constrained devices: it can use 40% less memory at the expense of being slightly slower (depends on workloads and is of no importance for software such as BubbleUPnP Server and MinimServer). If it is available as a package, I would suggest to use it. RE: Java memory/version issue [edited]. - simoncn - 03-03-2024 16:21 @bubbleguuum: Thanks for these observations and suggestions. @MarmiteSandwich: I would like to establish whether or not there is a memory issue with Java 11 as this version currently has the latest support expiry date of any Java version and I am considering adopting it as a reference version for the next few years. RE: Java memory/version issue [edited]. - bubbleguuum - 03-03-2024 16:29 After a few years with Java 11, I have recently (a few months) standardized on Java 17 for all BubbleUPnP Server installs bundling a JRE (Windows, Docker, macOS). For Docker, I made both OpenJDK and OpenJ9 images for x86_64 and arm64. RE: Java memory/version issue [edited]. - MarmiteSandwich - 03-03-2024 16:40 (02-03-2024 18:08)simoncn Wrote: Please save the MinimServer log files that show this.Simon, 3 txt files in the attached zip file. I will pm you with a pwd and other details. Regards, Marmite RE: Java memory/version issue [edited]. - simoncn - 03-03-2024 21:25 (03-03-2024 16:29)bubbleguuum Wrote: After a few years with Java 11, I have recently (a few months) standardized on Java 17 for all BubbleUPnP Server installs bundling a JRE (Windows, Docker, macOS). For Docker, I made both OpenJDK and OpenJ9 images for x86_64 and arm64. JDK 17 is supported until 30 Sep 2029 and JDK 11 is supported until 30 Sep 2031. Important bug fixes appear to be routinely backported to both JDK 17 and JDK 11. This gives JDK 11 a slight advantage in terms of long-term support. Also, MinimServer supports some very old platforms such as the QNAP TS-109/209/409 and some old Synology and NETGEAR devices with GLIBC 2.4. It also needs to run on a number of ARMv5 devices. This combination is challenging for building recent versions of the JDK but I have been able to find a way through for JDK 11 and JDK 14. I haven't yet tried building JDK 17 for these old platforms but I expect this will be even more difficult. |