![]() |
How do you stop Memory Leaks?
So you turn on your tablet, fresh boot, everything is great! Load applet shows basically no usage for processor and memory.
You open some programs, do some stuff, close the programs down, and the load on the tablet's memory is higher than it was after fresh boot. most of the time this doesn't interfere much with anything, but sometimes it does. For example if I run OpenOffice 2.4 after a fresh boot its very fast snappy etc. If I run it once memory leaks have set in it is very slow, borderline unbearable. I find myself having to reboot the NIT when I wan to use Open Office. Is there a way around the memory leaks? Is there a way to identify them and kill the processes? Or avoid them from occurring at all? Thank a lot for any help. |
Re: How do you stop Memory Leaks?
Hmm, I don't experience this phenomena. If I close down all applications, my tablet is just as responsive as after a boot.
Are you sure a specific process hasn't hung? |
Re: How do you stop Memory Leaks?
Quote:
For example when you open canola and then close it, canola will also open atabake, and python 2.5 a little after you close it, atabake should close as well. Python 2.5 remains open, adding to the use of memory. (I usually terminate this process by hand.) I am guessing that this happens with other programs as well, I just am not able to recognize which processes they are from. So you're saying that when your using a load applet (that shows memory usage) after having kept the tablet on for a day using various applications, if you close all applications down, the memory level goes back to the minimum where it was after the reboot? For me my load applet memory shows 1 bar when I first boot, and after opening and closing some programs it shows 2-3 bars... |
Re: How do you stop Memory Leaks?
Use lots of duct tape. :p
|
Re: How do you stop Memory Leaks?
Quote:
|
Re: How do you stop Memory Leaks?
Quote:
Quote:
|
Re: How do you stop Memory Leaks?
Quote:
|
Re: How do you stop Memory Leaks?
for real though: You could try this:
Make the font in terminal smaller or use ssh (so you can see more of the print out). From terminal: $ ps aux It will list all processes and how much RAM they are using and how much processor. If you find a renegade process, you can either kill it using the process id or with the command killall. |
Re: How do you stop Memory Leaks?
Quote:
|
Re: How do you stop Memory Leaks?
anyway to get them to shut down immediately? One thing I hate, is I use canola in the car for all my music, and whenever I get out and take the N810 out of the holder and lock it to put it in the sleeve, the screen doesnt go blank. I get this same behavior if ive used navicore as well.
|
Re: How do you stop Memory Leaks?
Canola was just an example. I don't really use it much anymore. But I guess the same thing happens with other programs.
@Brent Wow your usage goes back down to one bar? After using what programs and for how long? Anyone else share my experience? @Neatojo the load applet allows me to look at a list of processes and their memory usage, but also i would not know which ones i need or not. |
Re: How do you stop Memory Leaks?
I haven't checked htop, and I don't see a problem in Load Applet, but, judging subjectivley, my experience is more like Dantonic's than BrentDC's. I find if I open many windows in MicroB or in Tear, things seem to slow down and rebooting fixes it. Even stopping and restarting the browser does not seem as effective as a reboot.
|
Re: How do you stop Memory Leaks?
Quote:
|
Re: How do you stop Memory Leaks?
Quote:
My device is always just as responsive as when I first boot it after closing everything down (namely the browser, it sucks down quite a bit of memory when open). The only thing 'different' with my device is that I boot off an sd card and have a massive partition for swap (~400 mb). But my device was always like that, even before I made the huge swap partition (the swap is for debian applications, mostly). |
Re: How do you stop Memory Leaks?
Quote:
I understand that your device remains responsive when using those apps, but what i'm trying to get at is slightly different. When I use my everyday apps like maemo mapper, gpe calendar todo list, almost ti calc, mediaplayer, mplayer, mytube, and I switch among them my device also remains as responsive as before. This does not take away from the fact that memory leaks are still occurring. I think the leaks do not keep incrementing, for example if I open mediaplayer and when I close it it leaves some unnecessary process running taking up memory, when I go to open it again later in the day, I guess it would use that already open process as opposed to reopening a new instance of it. (mediaplayer as an example.) Although these unnecessary processes do not interfer when I'm using small apps, and when I'm using them a few at the same time, they do interfere when I'm trying to run a heavier app like Openoffice or when I'm using several small apps at once. |
Re: How do you stop Memory Leaks?
Quote:
But after I close all apps, my load-applet is always 1/4 bars. |
Re: How do you stop Memory Leaks?
Wow I'm so jealous of you!
:D Not sure what's going on with my tablet then, maybe I just need a brand new reflash... idk I'm very curious to know what everyone else's experience is like regarding this, I'd like to figure out if I'm one of the select few, along with GeraldKo |
Re: How do you stop Memory Leaks?
i've got an 8gig n810 and in a few years the omap4 chip's will be out !! :D
loading my tablet up with goodies, and will be getting a solar charger, and studying the sdk's |
Re: How do you stop Memory Leaks?
If you fill the RAM with applications, some of it will go to the swap file/partition. Once you close those apps the swapped memory remains in swap, and so when booting a new application which needs something which is in swap, it may start slower because the time needed to load what it needs from swap.
|
Re: How do you stop Memory Leaks?
In the case of opening many many windows in the browser being fast-ish the first time and slow-ish subsequent times is partly a side effect of swapping to sd/mmc.
Despite what you might think, random writes to flash are very very slow. A 4k write from the OS/device migh require the card itself to first read 256-512k of data, modify 4k of it, and write back 256-512k, because its native block size is that huge. You don't notice this causing any slowdown with photos, videos, songs and so on, because they're pretty large. The first time you push your tablet's memory use close to and over its physical SDRAM capacity, the swap file/partition is empty, the OS can pick whatever it wants from ram that it thinks is least needed and write it out sequentially. It might achieve rates of over megabyte per sec the first time. After you've closed the browser, you might use programs that had parts of themselves swapped out to flash, those get read back in then on a as-needed basis. A copy is retained on flash in case the os wants to swap out that exact same thing again it wont have to write, it can just drop it from ram. The program might write to or change that memory though, in which case the chunk on flash is freed and has to be written again if OS wants to swapout. A form of fragmentation happens in the swapfile. Thus, the next time you open loads of browser windows, the swapout of other programs wont happen sequentially to flash, instead it will be a little piece here, a little piece there, in random order. This is extremely slow compared to firt time. It's not unusual for memory cards to drop to speeds of 16 KILObytes/sec or worse under such loads. Brand name cards no exception. Higher class cards might help, unless they consist of multichannel flash in a parallell setup, which might make blocksize bigger, which makes random write speed worse (but boosting sequential write speed). So one source of slowdown over time is swap "fragmentation" and flash-based storage's inherent allergy towards seek-heavy write loads. Programs themselves might grow bigger over time due to internal heap fragmentation as well, which will make you run into swapping faster. Neither of these things are memory leaks. |
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 17:02. |
vBulletin® Version 3.8.8