Bug 104887 - [Version 18.1] Memory leak when frequently create shaders on ubuntu/Linux
Summary: [Version 18.1] Memory leak when frequently create shaders on ubuntu/Linux
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium critical
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-31 15:30 UTC by Jiancong
Modified: 2018-02-01 02:15 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
including opengl_demo.zip valgrind.result glxinfo.txt (47.54 KB, application/zip)
2018-01-31 15:30 UTC, Jiancong
Details

Description Jiancong 2018-01-31 15:30:02 UTC
Created attachment 137091 [details]
including opengl_demo.zip valgrind.result glxinfo.txt

Hi all,
   I ran a test program in ubuntu 16.04, mesa 18.1. Please see attached glxinfo.txt for system information and opengl_demo.zip for test program.

   The test program use create simple shader 10 times. Using valgrind as following 'valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes ./es2tri', it easy to get a memory leak report as in attachement.

==24757== LEAK SUMMARY:
==24757==    definitely lost: 144 bytes in 2 blocks
==24757==    indirectly lost: 8,000 bytes in 40 blocks
==24757==      possibly lost: 1,460,261 bytes in 4,429 blocks
==24757==    still reachable: 165,485 bytes in 115 blocks
==24757==         suppressed: 0 bytes in 0 blocks
Comment 1 Kenneth Graunke 2018-01-31 17:55:42 UTC
Your program appears to be terminating before it reaches eglDestroyContext and the eglMakeCurrent that unbinds the context.  With the context and screen not being destroyed, we have no opportunity to clean up, and everything appears to be leaked.

If you fix your app to destroy the context, there should be no leaks.
Comment 2 Jiancong 2018-02-01 02:15:30 UTC
As you said, I changed the exit event loop using "Esc" key, avoiding the error, there is no leaks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.