3MB Memory Leak in KDrive Xfbdev
vrushali shinde
vrushali1201 at gmail.com
Mon Oct 25 23:26:58 PDT 2010
Hello All,
I need to launch XServer in a thread and terminate(release resources and
kill thread) XServer whenever required. To achieve this, I have created a
shared library of Kdrive-XServer. To start XServer I load the Xserver shared
lib, and launch the Xfbdev server in a thread. For terminating Xserver, I
call GiveUp (0); function, that releases the XServer resources, then I
dlclose on Xserver library. However, when I start and terminate XServer in
above way, there seems to happen 3MB of memory leak in every cycle. After
narrowing down it is seen that following 2 function calls increase the
memory to 3M at start and is not release at termination. The functions
are: InitInput(argc, argv); and InitAndStartDevices(); These are the
observation on ARM target board.
When above scenario is simulated on x86 machine, and Valgrind is run, it
does not show memory leaks in above mentioned functions, instead it shows
definite loss of 1,244 bytes of memory in KdInitOutput() and some other
minor definite losses.
I need to find out the 3M memory loss on target ARM board for
InitInput(argc, argv); and InitAndStartDevices(); functions. For this I did
try to release memory allocations in InitInput(), but no success. If I
comment below lines from KdProcessArgument(), then the 3M chunk leak does
not happen however with this mouse and keyboard are not initialized and I
need to have keyboard and mouse. Can anyone help me out to find out the 3M
chunk and how to avoid it / release it?
<----------------------
KdAddConfigKeyboard("keyboard,/dev/tty0");
KdAddConfigPointer("mouse,/dev/input/mice");
kdHasPointer = TRUE;
kdHasKbd = TRUE;
---------------------------->
Thanks and Regards,
Vrushali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101026/231ece4c/attachment.html>
More information about the xorg-devel
mailing list