OpenJDK Memory Leak

The worst monsters in the Hearthlands warp the fabric of space and time...
User avatar
r0ck4ev3r
Posts: 282
Joined: Tue Mar 13, 2012 10:30 pm

OpenJDK Memory Leak

Post by r0ck4ev3r »

When I launch any haven(modded or not) thru steam the OpenJDK will eat ram till it crashes;
With original Java .jar no issues.

Is anyone else seeing this issue launching through steam's portal?
"Don't just have an idea- have all of them." ~ Niv-Mizzet
User avatar
vatas
Posts: 5255
Joined: Fri Apr 05, 2013 8:34 am
Location: Suomi Finland Perkele

Re: OpenJDK Memory Leak

Post by vatas »

From Hurricane client's Discord server (info channel):
I've also been playing on GraalVM 21 (some different open-source java distribution based on OpenJDK), and I seem to get like 15-20 extra FPS out of the client.
https://www.graalvm.org/downloads/ (select 21 from the drop-down menu).

Personally I have Java 15 and Hurricane (standalone.) The Steam version of Hurricane should use an on-board version of Java.
Steam Note: The Steam Workshop client is already using Java 23 (not working with the standalone client for now), so you don't have to change your Java version if you're playing through Steam via the Workshop client.
Haven and Hearth Wiki (Maintained by volunteers - test/verify when practical. Forum thread

Basic Claim Safety (And what you’re doing wrong
TL:;DR: Build a Palisade with only Visitor gates.)

Combat Guide (Overview, PVE, PVP) (Includes how to escape/minimize risk of getting killed.)
User avatar
r0ck4ev3r
Posts: 282
Joined: Tue Mar 13, 2012 10:30 pm

Re: OpenJDK Memory Leak

Post by r0ck4ev3r »

So the temp fix I ended up using is to: force steam to stop using OpenJDK

I used Java 25.0.1, and moved its Java, Javaw, and Javac executables into steams' \common\Haven\jre
"Don't just have an idea- have all of them." ~ Niv-Mizzet
bopke
Posts: 16
Joined: Thu Mar 10, 2022 8:35 pm

Re: OpenJDK Memory Leak

Post by bopke »

I had the same issue and it turns out it was connected to discord detecting game, when I toggled that off in discord the issue went away.
User avatar
loftar
Posts: 9096
Joined: Fri Apr 03, 2009 7:05 am
Location: Your character database

Re: OpenJDK Memory Leak

Post by loftar »

I don't think it's an issue intrinsic to OpenJDK, at least. I also use OpenJDK, and I haven't had any detectable memory leaks.
bopke wrote:I had the same issue and it turns out it was connected to discord detecting game, when I toggled that off in discord the issue went away.
That's interesting if true. Can anyone else confirm?
"Object-oriented design is the roman numerals of computing." -- Rob Pike
bopke
Posts: 16
Joined: Thu Mar 10, 2022 8:35 pm

Re: OpenJDK Memory Leak

Post by bopke »

I also recorded now the behaviour. I don't even need to get into the world. This is recorded with freshly downloaded autohaven, but client from steam is showing the same behaviour.

https://www.youtube.com/watch?v=Ku1-hZYgb5g

The memory usage will climb endlessly, and performance of the game will deteriorate until it is unable to pump next frame at all
Hayaikawa
Posts: 3
Joined: Tue Jan 10, 2012 2:25 am

Re: OpenJDK Memory Leak

Post by Hayaikawa »

bopke wrote:I also recorded now the behaviour. I don't even need to get into the world. This is recorded with freshly downloaded autohaven, but client from steam is showing the same behaviour.


The memory usage will climb endlessly, and performance of the game will deteriorate until it is unable to pump next frame at all

I am having the same exact issue...
User avatar
loftar
Posts: 9096
Joined: Fri Apr 03, 2009 7:05 am
Location: Your character database

Re: OpenJDK Memory Leak

Post by loftar »

Hayaikawa wrote:I am having the same exact issue...
So it helps if you turn off Discord's game detection?
"Object-oriented design is the roman numerals of computing." -- Rob Pike
Hayaikawa
Posts: 3
Joined: Tue Jan 10, 2012 2:25 am

Re: OpenJDK Memory Leak

Post by Hayaikawa »

Ok, so potential fix.

When I stream the game play in Discord the memory leak speed is reduced by about 10 times.
I can actually play the game at full frames and it takes around 5 minutes before my ram is maxed out.

I have tested multiple times, literally streaming the game while it runs stops 90% of the way.
Stoolej
Posts: 1
Joined: Sat Nov 02, 2024 1:33 pm

Re: OpenJDK Memory Leak

Post by Stoolej »

loftar wrote:
Hayaikawa wrote:I am having the same exact issue...
So it helps if you turn off Discord's game detection?

I, on the other hand, have to kill the Discord process every time, otherwise I encounter a memory leak.

Return to “Bugs”