Bug 573354

Summary: [Linux] Find native memory leaks in SWT
Product: [Eclipse Project] Platform Reporter: Alexandr Miloslavskiy <alexandr.miloslavskiy>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: alexandr.miloslavskiy, simeon.danailov.andreev
Version: 4.19   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=569647
https://bugs.eclipse.org/bugs/show_bug.cgi?id=570238
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573432
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573472
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573473
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573477
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573536
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573573
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573611
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573633
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573697
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573727
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573758
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573983
https://bugs.eclipse.org/bugs/show_bug.cgi?id=574065
Whiteboard:

Description Alexandr Miloslavskiy CLA 2021-05-04 11:36:46 EDT
In Bug 570238 and Bug 569647 I used Valgrind to hunt down some SWT native-side memory leaks. I'll use this Bug to share my tools when they're ready.
Comment 1 Alexandr Miloslavskiy CLA 2021-05-04 15:30:23 EDT
OK, I polished the scripts enough to be usable outside my lab :)

Start here:
https://github.com/SyntevoAlex/JavaValgrindScripts

There should be sufficient explanations in the readme.

@Simeon I'll be pleased if you can try that soon, so that my effort is not in vain :)
Comment 2 Alexandr Miloslavskiy CLA 2021-05-04 15:35:12 EDT
Suppressions try to remove all sorts of noise. For example, global caches in JVM/GTK are considered to be leaks, because technically they are: they are allocated and stay there until the very end.

Still more suppressions could be added, but it takes time to investigate and make sure that these are not actual leaks. When in doubt, run something in a loop and see if reported leak grows or not.
Comment 3 Simeon Andreev CLA 2021-05-05 02:33:50 EDT
(In reply to Alexandr Miloslavskiy from comment #1)
> OK, I polished the scripts enough to be usable outside my lab :)
> 
> Start here:
> https://github.com/SyntevoAlex/JavaValgrindScripts
> 
> There should be sufficient explanations in the readme.
> 
> @Simeon I'll be pleased if you can try that soon, so that my effort is not
> in vain :)

Thanks a lot Alexandr!

In fact we have already a memory leak in Eclipse/our product that we need to check, I'll try using the tool this and next week to hopefully find out what code is leaking.
Comment 4 Alexandr Miloslavskiy CLA 2021-05-10 20:18:25 EDT
A much faster tool:
https://github.com/SyntevoAlex/JavaJemallocScripts.git

@Simeon, give it a try!