-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Insufficient system resources" after many calls to WindowUtils.getAllWindows(true) #1042
Comments
|
Running it now, I'll give an update in a couple days if it hasn't had any issues. Thanks for the quick turnaround! |
@matthiasblaesing my program's been running for a little over 3 days now with no crash. Looks like the problem is fixed, thanks! |
Merged the changeset - thank you for taking time to test. I pushed an updated snapshot build to the sonatype snapshot repository. https://oss.sonatype.org/content/repositories/snapshots//net/java/dev/jna/jna/5.2.0-SNAPSHOT/ |
This is for my project rensa, specifically this class: https://github.com/rococode/rensa/blob/master/src/main/java/com/tangleroad/rensa/utils/WindowTitleFetcher.java
The main thing that's happening there is that
getProcessWindowTitle
is called frequently (a couple times a second). That method makes a call toWindowUtils.getAllWindows(true);
.After a large number of calls - I haven't measured the exact time but the program runs for 20-30+ hours before this happens - I start getting a resource problem that prevents me from calling that method anymore. It seems that I'm hitting the limit for open (file?) handlers or something like that, but I don't see anywhere that I'm clearly leaking these "resources".
You can see in the same class a commented-out
getProcessWindowTitle2
, which does the same thing but before I knewWindowUtils.getAllWindows(true);
existed. It also suffered from the same issue of getting the win32exception after running for several hours.Am I just missing some call I should be making to free whatever's causing issues? Or is there some bug in JNA that's holding on to resources for too long?
The text was updated successfully, but these errors were encountered: