OpenJDK 'Not Enough Space' Java Error

Hello. I’m getting this weird error of ‘Not Enough Space’ relating to the memory. I’m running everything on 2024 beta. I have multiple times make sure that I have the beta firmware on the roboRIO. I even tried to boot the roboRIO into the safe mode and then reimage. It worked for a few instances but the errors come up again.

Here is the code repo: https://github.com/Team4065/AdvantageKit-23-24/tree/main/Swerve
I have attached the riolog file.
MemoryError.json (2.2 KB)

Thank you!

Using a Rio1 or Rio2? This is fairly common with the Rio1, especially when using AdvantageKit. It can get quite memory-intensive.

I’m using rio 1. Is there any workaround to this?

Get a Rio2…? Kidding

You’d need to scale back what youre doing with AdvantageKit. Log less things. But even then, you’re tiptoeing the line.

Definitely search for similar questions here on CD. It was very common a couple years ago I believe (my team ran into it as well). There may be better suggestions in those posts

1 Like

We’ve seen this happen as well on a RIO 1 with the 2024 beta. If it disappears for a few deploys after power cycling the robot then it’s not a problem with AdvantageKit (this is the case for us). Seems like a problem with the robot code process not being stopped correctly when redeployed but I haven’t been able to investigate yet.

Seems to be an issue with the beta itself.

we have this same issue, and after clearing the temp files and or rebooting the roborio (in FRC drivestation) it works. It’s annoying… I think the royal “they” are working on a fix.

Do you know how to access the temp files in driverstation?

I was having the same issue while using a robotRIO 1.0 and everything on 2024 beta. Getting rid of unused System.out.println() and SmartDashboard.putNumber() methods calls seemed to help. Sometimes, though, when I deploy the driver station still says I don’t have robot code, but restarting the roboRIO seems to fix this.

we use filezilla and FTP into the roborio 10.te.am.2 usually

See this issue:

We have a potential fix in the upcoming beta 4.

4 Likes

To be clear, this is an issue that affects all Java robot programs (see the issue Peter linked). Extra thought can sometimes be required to work around the memory limits of the RIO 1, but that consideration applies to any vendor library or code feature. AdvantageKit is safe to use on the RIO 1, and the current version has no known issues related to high memory usage.

3 Likes

Yes, I didn’t mean to imply AK was the solitary cause, just that it can contribute to higher memory usage in the java app depending on how it’s used/configured. That said, youre 100% right that this is a problem that has the potential to occur in any app with any libraries.

1 Like

Thank you. Although it’s annoying to restart the JRE, it fixed the issue.