Page 11 of 16
Re: KXStudio FAQ
Posted: Sat Aug 25, 2012 7:33 pm
by briandc
falkTX wrote:briandc wrote:Someone on gearsluts.com was asking if I had tried OpenOctave. I see from the website openoctave.org that the repository has been created. Can I go ahead and add it?
brian
Yes, sure, I maintain that repository.
Thing is, openoctave development has stopped.
And I must warn you, they can be very hard to deal at times...
(example of irc chat just a few days ago:
http://kxstudio.sourceforge.net/Paste/repo/DLxTl 
)
Yikes..
-Of course, we all need vacations or a break sometimes.. --it's just that some don't realize how much they need it!
brian
Re: KXStudio FAQ
Posted: Tue Aug 28, 2012 12:15 pm
by Thad E Ginathom
falkTX wrote:I think this is correct, although I'm not 100% sure. Still, it kinda works like this.
Yes, I think it does work like this. People have a thing about keeping their memory empty ... then why did they buy it!
If Linux/Unix really needs
more memory, it will be swapping memory out to disk. Even this it may do just to be on the safe side!
Re: KXStudio FAQ
Posted: Tue Aug 28, 2012 3:25 pm
by briandc
Thad E Ginathom wrote:falkTX wrote:I think this is correct, although I'm not 100% sure. Still, it kinda works like this.
Yes, I think it does work like this. People have a thing about keeping their memory empty ... then why did they buy it!
If Linux/Unix really needs
more memory, it will be swapping memory out to disk. Even this it may do just to be on the safe side!
So true...
I probably didn't to upgrade from 2GB to 4... oh well.. at least now I know better how memory is used!
brian
Re: KXStudio FAQ
Posted: Wed Aug 29, 2012 4:58 am
by brummer
falkTX wrote:briandc wrote:Ok, a quick question about RAM usage:
I start by opening QJack, then the instrument I want to play, and then Audacity. After I make a track, I close the instrument, open another, make a new track, etc. At the end, I close everything, QJack last.
Sometimes I run "top" in the terminal to see what's using what, etc. I see that at the start of the session, I'm using little RAM. But by the end of the session, I'm using all my RAM, even after everything is closed.
Should I re-log-in in order to free up the RAM? Or reboot? (At the moment, I have only Firefox and QJack open, but RAm usage is almost 4GB!)
Unless some application is consuming that much RAM, this is a known linux feature afaik.
The memory used by applications is not completely free'd, as there's no need for it. It will be re-used later in case you start the same apps as before, thus making it start faster.
When you get out of memory, the older unused one will be used.
I think this is correct, although I'm not 100% sure. Still, it kinda works like this.
No, if a application didn't free up the used RAM, it's a bug. This kind of bug is known as MEM LEAK.
It's not possible to use this RAM again when the application starts again, because the app needs a pointer to the reserved RAM. So this RAM is lost for the session.
Only loaded shared library’s, which also use RAM by the way, could be reused when loaded.
You could free your RAM with the following command as root (sudo)
Code: Select all
sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
Re: KXStudio FAQ
Posted: Wed Aug 29, 2012 7:01 am
by Thad E Ginathom
Well, despite quite a few years of Unix system admin, I'm very rusty, had brain cells destroyed by using W-XP for ten years before returning to LInux, and generally out of date, so I am not contradicting you, and feel free to correct me, but...
I agree with you about application not freeing up memory: that is a bug. Does the system have no method of cleaning up memory belonging to no-longer-running processes?
What I think I remember from my AIX days is that the system itself, rather than any application, maintains a lot of stuff in memory just to save it from reading it off the disk again. It can't tell you are only going to run a program once. When it needs that memory, though, it will recover and reuse it.
As you can tell --- I'm pretty vague about this

Re: KXStudio FAQ
Posted: Wed Aug 29, 2012 7:23 am
by brummer
Memory reservation is handled by pointers, they are part of the running instance of a application and created when a application reserve memory. So, to get access to the reserved mem, you need this exact pointer. When you close the application, the pointer will destroyed, and you haven't any chance to access the reserved memory again. There is nothing the system can do about that.
A clean written application wouldn't leave a bit in the mem when closed. In some cases, that isn't possible, then we spoke from a mem leak. But as a developer you must try to keep that leaks as small as possible.
Other than that, is the use of shared library’s, they are handled by the system, they will be keep in memory as long the memory allow that, they will reused, when needed, and they will unload(swapped) when the memory get to full.
The command I have post above will simply flush the memory and remove all unused reservations including loaded shared library’s which ain’t in use.
Re: KXStudio FAQ
Posted: Wed Aug 29, 2012 10:44 am
by briandc
Does all this have anything to do with apps that are "sleeping" or "zombies" or "orphans?"
And, that line of command that should wipe the memory clean... shouldn't every app have that line in it for when its closed?
Just curious..
brian
Re: KXStudio FAQ
Posted: Wed Aug 29, 2012 11:02 am
by brummer
briandc wrote:Does all this have anything to do with apps that are "sleeping" or "zombies" or "orphans?"
Sure, apps that "sleep" didn't give there memory free, as well as "zombies", which are didn't clean closed apps.
I didn't know what you mean by orphan apps?
briandc wrote:And, that line of command that should wipe the memory clean... shouldn't every app have that line in it for when its closed?
No, there are much easier and cleaner solutions for applications to clean up after themselves. It's a question of design. Simply any reservation needs a corresponding free call, that's all. Linux, for example provide vallgrind to locate mem leaks in applications, so that they could easy repaired (if you have access to the source).
Also, like I said, this command needs root privileges witch most apps hopefully didn't have. Also, it is a system wide clean up, no application should do that ever, except it call itself "RAM-ERASER" or so.

Re: KXStudio FAQ
Posted: Wed Aug 29, 2012 4:45 pm
by Thad E Ginathom
Applications using memory is one thing, but there is a heap of stuff that the kernel caches, and can happily look after.
Re: KXStudio FAQ
Posted: Wed Aug 29, 2012 5:30 pm
by brummer
Thad E Ginathom wrote:Applications using memory is one thing, but there is a heap of stuff that the kernel caches, and can happily look after.
Sorry, Thad, but I have no idea what the hell you talk about. As a developer, I know how Linux systems handle mem usage. All, the kernel keep in mem is shared library’s. It is simply not possible to keep anything in mem for reuse, when a application is stopped. Therefore, you must have a running daemon of the application which gives the pointers to the "what ever you mean is keep in RAM", ad that must coded in the application itself. I guess that this impression comes to you, because Linux make heavy use of the shared lib technology, therefor many applications start up faster when they are started the 2. time in a session.
But that have nothing to do with any application specific stuff, which the kernel keep anywhere in RAM to reuse it, for the case that the user decide to start the app again.
Re: KXStudio FAQ
Posted: Wed Aug 29, 2012 6:20 pm
by Thad E Ginathom
What falkTX and I are thinking of (I think

) is disk caching.
From a quick google, it is explained nicely for non-developers here
Why does Linux use so much memory?
Re: KXStudio FAQ
Posted: Wed Aug 29, 2012 7:01 pm
by brummer
Ah, okay, that is indeed a different story and not very application specific.
Re: KXStudio FAQ
Posted: Thu Aug 30, 2012 6:46 am
by briandc
brummer wrote:briandc wrote:Does all this have anything to do with apps that are "sleeping" or "zombies" or "orphans?"
Sure, apps that "sleep" didn't give there memory free, as well as "zombies", which are didn't clean closed apps.
I didn't know what you mean by orphan apps?
No, not orphaned apps, but orphaned processes. I remember reading something about "parent processes" and "orphaned processes," where the parent (the app itself?) is closed, but other processes caused by it are still running when they should already be "dead."
I think that's how it went..
(Keep in mind, I'm no programmer..!)
brian
Re: KXStudio FAQ
Posted: Thu Aug 30, 2012 1:54 pm
by Thad E Ginathom
A brain cell quotes... a
zombie process is a process that occupies a slot in the process table but nothing else.
If it quoting correctly, it means that it is costing nothing nothing in resources.
A lot of peoples' expectations of operating systems have been formed by a certain, err, popular, commercial desktop system, which, throughout most of its iterations has actually done many things very badly. I'm still relatively new to Linux, but I began my computing with Unix, and thus, I expect that an operating system should be (with a little room for error; nothing's perfect!)
essentially well designed and efficient. Thus we should be able to assume that Linux is looking after all the basics, like memory and process management, and doing so properly.
Developers are welcome to disillusion me

Re: KXStudio FAQ
Posted: Fri Aug 31, 2012 3:55 am
by brummer
Thad E Ginathom wrote:A brain cell quotes... a zombie process is a process that occupies a slot in the process table but nothing else.
If it quoting correctly, it means that it is costing nothing nothing in resources.
The zombies itself are not the problem, but they indicate that the parent process didn't clean up proper.