Hello All,<div>I need to fix memory leak issue urgently, any inputs regarding this would very useful to me.</div><div>Thanks again.<br><br><div class="gmail_quote">On Wed, Oct 27, 2010 at 4:33 PM, vrushali shinde <span dir="ltr">&lt;<a href="mailto:vrushali1201@gmail.com">vrushali1201@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><span style="font-family:arial, sans-serif;font-size:10px;border-collapse:collapse"><div class="im">Hello All, <div>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.</div>



<div>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.</div>



<div>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?</div>



<div>&lt;----------------------</div><div> KdAddConfigKeyboard(&quot;keyboard,/dev/tty0&quot;);</div><div>    KdAddConfigPointer(&quot;mouse,/dev/input/mice&quot;);</div><div>    kdHasPointer = TRUE;</div><div>    kdHasKbd = TRUE;</div>



<div>----------------------------&gt;</div><div><br></div></div><div class="im"><div>In addition to information below, I also get get following error when closing VT &quot;Cant deallocate console...&quot; Can  this error contribute to some or all of the 3M memory leak?<div>


Please let me know if anyone has got any clue about this  or have faced simlar issue.</div></div><div><br></div></div><div>Thanks in advance,</div><div>Vrushali</div></span>
</blockquote></div><br></div>