Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Eclipse is leaking handles when opening/closing an editor
icon4.gif  Eclipse is leaking handles when opening/closing an editor [message #986497] Tue, 20 November 2012 16:15 Go to next message
Pr0 Clipse is currently offline Pr0 ClipseFriend
Messages: 4
Registered: March 2012
Junior Member
This behavior has been observed under Windows 7 x64 in an enterprise IT environment.
Steps to reproduce:

1. Open the task manager
2. Switch to the process tab and make the "Handles" column visible
3. Start eclipse
4. Switch back to the task manager and note down the number of handles eclipse.exe is holding
5. Switch back to eclipse and open a java file

-> the number of handles increases by ~50 (at least on my system)

6. Close the file (trigger garbage collection if you like.. it changes nothing)

-> the number of handles does not decrease

7. Repeat 5. and 6. until you eventually run out of handles....

This is a serious problem since we're opening and closing a large number of files in our JUnit test suite to test our RCP based product.

Additional info: Using processhacker I can tell that almost all newly created handles are "Token" handles. So it's seems it's not a SWT handle problem, since the number of GDI and USER handles stays the same -- no matter how many files I open and close.

Does anyone know if this is a general eclipse problem or if it somehow can be attributed to the windows environment (group policies)?

Regards
Re: Eclipse is leaking handles when opening/closing an editor [message #986529 is a reply to message #986497] Tue, 20 November 2012 18:23 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
What version of Eclipse are you seeing this in? Perhaps its related to this:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=393823

- Konstantin
Re: Eclipse is leaking handles when opening/closing an editor [message #986638 is a reply to message #986529] Wed, 21 November 2012 09:34 Go to previous messageGo to next message
Pr0 Clipse is currently offline Pr0 ClipseFriend
Messages: 4
Registered: March 2012
Junior Member
Sorry, I forgot to mention I'm using Eclipse 3.7.2

Unfortunately it's not as easy as superfluos editor references as I have checked for those in our product as well. As a matter of fact, I even found and fixed some memory leaks in the process, but the main problem does not seem to be related to memory or even a specific editor. Maybe opening files is the root cause of this... I will try to narrow it down to a more fine grained level.
Re: Eclipse is leaking handles when opening/closing an editor [message #986690 is a reply to message #986638] Wed, 21 November 2012 11:18 Go to previous messageGo to next message
Pr0 Clipse is currently offline Pr0 ClipseFriend
Messages: 4
Registered: March 2012
Junior Member
Okay, this is really wierd. The problem also occurs when opening/closing empty views!
Try this:

- Create the example mail RCP plugin
- Comment out the code in View.createPartControl()
- Start the plugin as Eclipse Application
- Open the task manager to monitor the handles of javaw.exe
- Close the Message View
- Press the + button to create a new (empty) view
- I'm using processhacker now to see details about the handles
-> Normal handles increased by 15 (anything but GDI/User handles)
-> GDI handles increased by 2
-> User handles increased by 15
- Now close the message view
-> Normal handle count does not change!
-> GDI handles decreased by 2
-> User handles decreased by 15

Now, if you don't close the message view after creating it, each time you create a new message view only 3 normal handles and 1 GDI handle are allocated.

Note: The problem also occurs in eclipse 4.2.0

Maybe I should raise an official bug report...
Re: Eclipse is leaking handles when opening/closing an editor [message #986798 is a reply to message #986690] Wed, 21 November 2012 16:35 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Did you try to use sleak to findout what handles those are?

Tom

Am 21.11.12 12:18, schrieb Pr0 Clipse:
> Okay, this is really wierd. The problem also occurs when opening/closing
> empty views!
> Try this:
>
> - Create the example mail RCP plugin
> - Comment out the code in View.createPartControl()
> - Start the plugin as Eclipse Application
> - Open the task manager to monitor the handles of javaw.exe
> - Close the Message View
> - Press the + button to create a new (empty) view
> - I'm using processhacker now to see details about the handles
> -> Normal handles increased by 15 (anything but GDI/User handles)
> -> GDI handles increased by 2
> -> User handles increased by 15
> - Now close the message view
> -> Normal handle count does not change!
> -> GDI handles decreased by 2
> -> User handles decreased by 15
>
> Now, if you don't close the message view after creating it, each time
> you create a new message view only 3 normal handles and 1 GDI handle are
> allocated.
>
> Note: The problem also occurs in eclipse 4.2.0
>
> Maybe I should raise an official bug report...
Previous Topic:adapter factory not loaded
Next Topic:Unable to create object of SAXBuilder.
Goto Forum:
  


Current Time: Fri Apr 19 20:22:55 GMT 2024

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

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

Back to the top