Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » ShutdownHooks causing heap memory overflow(In lock method of PidLock in GC, ShutDownHooks are getting added)
ShutdownHooks causing heap memory overflow [message #1863444] Fri, 02 February 2024 12:21 Go to next message
Eclipse UserFriend
I am using jgit 6.6.1, before that I was using jgit 6.3.0. After upgrading the version I am facing the issue of HeapSpaceError. I am running a java application which will run continuously.
Runtime.getRuntime().addShutdownHook(cleanupHook);
This will keep adding cleanupHooks in ApplicationShutdownHooks, but as application or JVM is not getting close this will increase the heap size utilization.

So, what is the solution for such application which will continuously running.
Re: ShutdownHooks causing heap memory overflow [message #1863468 is a reply to message #1863444] Sat, 03 February 2024 06:57 Go to previous messageGo to next message
Eclipse UserFriend
I don't understand your question.
Re: ShutdownHooks causing heap memory overflow [message #1863481 is a reply to message #1863468] Sun, 04 February 2024 23:23 Go to previous messageGo to next message
Eclipse UserFriend
I am currently using JGit version 6.6.1, having recently upgraded from version 6.3.0. Since the upgrade, I have been encountering Heap Space Errors in my Java application, which runs continuously.
The issue appears to be related to the addition of cleanup hooks in the ApplicationShutdownHooks. I have noticed that in upgraded version of JGit new PidLock with lock() method was introduced in jgit.internal.storage.file.GC class. As of my knowledge ApllicationShutdownHooks execute the hooks at the time of application or JVM closing but in our case it will not happen as application need to be run continuously, which lead to continuous insertion of hooks in ApplicationShutdown hooks and causing heap space error after some time.

[Updated on: Mon, 05 February 2024 04:53] by Moderator

Re: ShutdownHooks causing heap memory overflow [message #1863770 is a reply to message #1863481] Mon, 26 February 2024 04:37 Go to previous message
Eclipse UserFriend
Update to the latest release or master, this should contain the fix.
Previous Topic:EGIT gets a connection reset from azure
Next Topic:Push command did not fail due to insufficient privileges
Goto Forum:
  


Current Time: Thu May 22 07:17:09 EDT 2025

Powered by FUDForum. Page generated in 0.06863 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top