From: Verma on 11 Aug 2010 04:02 Hi all, We have developed an Matlab app which when launched, keeps slowing down the machine so much so that we need to kill Matlab or even restart the machine in a couple of hours. Following is a brief description of our app's architecture: 1. We use timers to periodically (~ 30 sec) update various graphs on GUI. 2. Most timer callback functions use persistent variables to keep the state. 3. We connect and disconnect to kdb database using a java library every time a timer call back function needs to update the GUI. 4. Data retrieved on every time is < 5000 rows and 10 columns takes under 1 sec. The app slows down events like tab switching in an hour or so, and in several hours slows down everything on the PC. Will be a great help if someone can point us in some directions we can explore. Regards, Sid
From: Jan Simon on 11 Aug 2010 07:37 Dear Verma, the information you gave is not sufficient to identify the problem. You can use the PROFILEr to see, where the time is lost. I guess, that you draw some diagrams or create some figure in each iteration without deleting the old ones. Then Matlab is exhausted with displaying millions of objects? Does the java-base connection to the database consume head-memory without freeing it afterwards? Kind regards, Jan
From: Yair Altman on 11 Aug 2010 10:52 It is possible that you have a memory leak in your system. The leak can be caused by the GUI objects and/or the Java code. If the leak is large enough, your computer will start to slow down when the physical memory is exhausted and your Operating System starts to use swap (disk) space for memory management. To determine whether this is indeed the issue, download and use Microsoft's Process Explorer utility from www.sysinternals.com - by clicking the Matlab process you will be able to see a graph of the actual memory used by Matlab over time. You can also use the built-in Matlab Profiler, if you use the undocumented memory-profiling options as explained here: http://undocumentedmatlab.com/blog/undocumented-profiler-options/ . The Profiler is helpful, but I am skeptical if you will find memory leaks using it. Yair Altman http://UndocumentedMatlab.com
From: Verma on 12 Aug 2010 06:06 Yair, Thanks a ton for your suggestions. Process explorer gave a lot of useful information. I am clearly able to see that number of GDI handles and User Handles keeps growing with time (reaches 9000 in 3 hrs). Memory itself is not growing so much (~300 MB, while 1.5 GB is unused). But I am clearing all axes (cla) before redrawing new graphs. Any guesses on why handles may be growing with time? Regards, Siddharth "Yair Altman" <altmanyDEL(a)gmailDEL.comDEL> wrote in message <i3udek$bl1$1(a)fred.mathworks.com>... > It is possible that you have a memory leak in your system. The leak can be caused by the GUI objects and/or the Java code. If the leak is large enough, your computer will start to slow down when the physical memory is exhausted and your Operating System starts to use swap (disk) space for memory management. > > To determine whether this is indeed the issue, download and use Microsoft's Process Explorer utility from www.sysinternals.com - by clicking the Matlab process you will be able to see a graph of the actual memory used by Matlab over time. > > You can also use the built-in Matlab Profiler, if you use the undocumented memory-profiling options as explained here: http://undocumentedmatlab.com/blog/undocumented-profiler-options/ . The Profiler is helpful, but I am skeptical if you will find memory leaks using it. > > Yair Altman > http://UndocumentedMatlab.com
From: Aleksandar Stojimirovic on 12 Aug 2010 06:07 Hallo, see this http://www.mathworks.com/matlabcentral/newsreader/view_thread/289128 maybe it can help you, and maybe you have some idea to improve my code!!!
|
Next
|
Last
Pages: 1 2 Prev: use of multi-scale filters Next: enforce correct entry - callback method |