![]() |
Re: How do you stop Memory Leaks?
And on top of that, there is something else:
https://bugs.maemo.org/show_bug.cgi?id=2615 |
Re: How do you stop Memory Leaks?
Quote:
If that's the case, then this is still happening even though I'm not using swap. |
Re: How do you stop Memory Leaks?
Maybe it is unrelated, but I often experience periods of unresponsiveness (5 minutes or so) when I pick up the tablet the next day after I left it with some open applications (mostly the browser microB). After that things go back to normal behaviour.
|
Re: How do you stop Memory Leaks?
Quote:
I've enabled virtual memory, hadn't used it till now, this should make it better I assume. |
Re: How do you stop Memory Leaks?
I'm not sure about jffs2, which is the filesystem used to store all the programs on the tablet, but atleast in standard linux there's a sorrt of swapping without virtual memory. A program consists of executable code and resources that are hardly ever changed, in a low memory situation, Linux can remove code of loaded programs that are inactive, since there's a copy on flash anyway. Programs also use some shared resources in the form of libraries, they might get the same treatment.
So, for example. Program A gets loaded when you boot the applet. A uses Library B, which also gets loaded. At some point, when you're using a Program C, the OS gets low on available memory, and might notice that there's no swap/virtual memory available, but parts of Program A and Library B hasnt been used for a long time, and the contents in memory is still same as it is on flash. It drops those parts from memory and makes a note to load it back from flash if it's ever needed again. Now later you want to use Program D, which uses Library B. It will take slightly longer to load because both D and B has to be read in from flash, compared to just D when tablet has just booted. Also, switching back to or using A can cause a delay. These delays could be a few seconds long, I'm guessing. There's actually a project for Linux called preload that keeps track of what programs you use, and if it notices there's free memory (as there would be after you close the browser, for example), it gives hints to Linux telling it to read stuff from flash and fill the memory with stuff that could be needed, so that you get faster response. All in all, memory management and handling is quite advanced and complicated in a modern Operating System, and especially measuring memory use can be extremely hard to do :) Of course, it's entirely possible still that some things do actually genuinely leak memory... |
Re: How do you stop Memory Leaks?
Wow thanks so much for that explanation shadow.
Very interesting the way it works. So when the OS stores part of the memory on flash to make room for other apps, maybe the Load Applet shows more memory being in use because it has in it's memory instructions to point the OS to the flash locations. So in other words, even though certain programs are no longer left in memory, some memory is still taken up to point to the the flash location where the "library" in question might be for example. Could this be what causes the load applet to show more memory in use even after closing all applications? |
Re: How do you stop Memory Leaks?
Per qole,
Quote:
But I wonder, do other people have qole's experience? Does starting fresh really make everything work better? The only complaint I have about how well everything works is that MicroB or Tear can stall out, and it seems I need to restart to get browsing back up to speed. Occasionally some other program will crap out and shut unexpectedly, but not often. I'm not sure it's worth rebuilding from scratch when, for the most part, everything works so damn well. |
Re: How do you stop Memory Leaks?
I'm not sure how load applet measures memory use, but generally if you close a program, all its executable code and libraries are kept in ram memory. You might notice this if you time how long it takes to start media player the first time, close it, and start again a second time right after. Might start faster the second time. Linux philosophy is free ram = wasted ram. After that, it's all about trying to be clever in deciding what to discard from ram when the need to load more stuff into it comes. Ideally you'd be able to predict the future and remove things that wont be used for awhile and load stuff that will be used soon, but predicting the future is notoriously difficult :)
|
Re: How do you stop Memory Leaks?
Quote:
|
All times are GMT. The time now is 14:47. |
vBulletin® Version 3.8.8