# No way to 'Sudo Purge' memory on Windows?



## Dracarys (Oct 13, 2014)

Hey guys,

This has become a real issue recently. When I close big sessions, around 15gb of RAM will be sitting in Task Manager. Now if I open another session, or the same session, that ram will almost act like it is being added to the session, instead of replacing current RAM. I soon get up to my RAM capacity and suffer performance issues, same as when you simply run out of ram.

It seems that this technique is unanimous among all the forums, but I can say that it does not work at all:

http://www.addictivetips.com/windows-ti ... s-7-cache/

Also keep in mind everything is fine when I first start a session, Kontakt memory server is OFF. Removing instruments in Kontakt does not free up RAM the way it should. There is also no processes in Task Manager consuming this much memory.

Anybody have any ideas?

Thanks

*UPDATE:
*
The issue doesn't seem to be application specific, I can load instruments in stand alone, in PLAY, PLAY within cubase, synths, rewiring, etc, it all has the same outcome, the ram just doesn't completely purge.

Where do I go from here, could it be the memory itself? Bios? What test should I run here?

Thanks!


----------



## JohnG (Oct 13, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*

I think you mean, "pseudo" purge.

I don't do a ton of swapping out samples on my PCs, so I don't have a good answer for you.


----------



## RiffWraith (Oct 13, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*



Casalena @ Tue Oct 14 said:


> When I close big sessions, around 15gb of RAM will be sitting in Task Manager. Now if I open another session, or the same session, that ram will almost act like it is being added to the session, instead of replacing current RAM.



That does not happen here. Using (mostly) Kontakt 4 & 5 inside Cubase in W7. 64-bit all the way around. 

Boot into W7 - TM reads 2.90 GB used
Load my template - TM reads 46.0 GB used
Close proj. - TM reads just over 3.00 GB used

What seq. are you using?


----------



## Dracarys (Oct 13, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*



JohnG @ Mon Oct 13 said:


> I think you mean, "pseudo" purge.
> 
> I don't do a ton of swapping out samples on my PCs, so I don't have a good answer for you.



After upgrading to Mavericks on my MBP, it is no longer "pseudo", the command is now "sudo purge"

Np thanks!


----------



## Dracarys (Oct 13, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*



RiffWraith @ Mon Oct 13 said:


> Casalena @ Tue Oct 14 said:
> 
> 
> > When I close big sessions, around 15gb of RAM will be sitting in Task Manager. Now if I open another session, or the same session, that ram will almost act like it is being added to the session, instead of replacing current RAM.
> ...




I'm using Cubase 6 64x, vst rack. Are you using Ve Pro? The new apple OS Mavericks has been giving me the same issue. About to revert back to Mountain Lion on my MBP


----------



## Andrew Aversa (Oct 13, 2014)

Could be an issue with your DAW setup. A good DAW should properly purge all RAM that was in use when closed... what are you using? Are you using any bridges?


----------



## RiffWraith (Oct 13, 2014)

zircon_st @ Tue Oct 14 said:


> A good DAW should properly purge all RAM that was in use when closed...



Right - _any_ app should do this.

Cas - I am confused.... your posts seem to be going back and forth from Windows to Mac OSs...


----------



## G.E. (Oct 13, 2014)

After closing a project my memory use usually decreases gradually back to normal so it takes a minute or two but I've never had any problems. My template is almost 40 gigs by the way. Have you tried waiting a minute before opening your other project ?


----------



## marclawsonmusic (Oct 13, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*

'sudo' is a Unix command (http://en.wikipedia.org/wiki/Sudo). Mac OSX is built on a Unix kernel, so you can run this command from Terminal on OSX.



> Right - _any _app should do this.


When an app doesn't release memory properly, this is affectionately known as a 'memory leak'. Sometimes the memory cannot be reclaimed without rebooting the computer.

Or, it could be a timing thing like G.E. said... maybe wait 10 minutes and get some coffee the next time you close a session.

However, if the memory never 'frees up' no matter how long you wait, then there is likely a bug in the program somewhere. You might have some luck Googling '<your_daw> memory leak'. Maybe there is a patch or update that corrects the problem.


----------



## mohurwitzmusic (Oct 13, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*

I'm also interested in this. 

When I switch VEPro metaframes or quit VEPro, it takes longer to unload the samples than it took to load them. As a result, switching metaframes takes more than double the time as the initial load. 

But if I simply restart or shut down the computer, it all happens rather rapidly--say, within 10 seconds.


----------



## Daryl (Oct 14, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*



Casalena @ Tue Oct 14 said:


> JohnG @ Mon Oct 13 said:
> 
> 
> > I think you mean, "pseudo" purge.
> ...


Sorry, are you talking about OSX? I thought it was a Windows question. Perhaps you'd be good enough to clarify.

D


----------



## snattack (Oct 14, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*



Daryl @ Tue Oct 14 said:


> Casalena @ Tue Oct 14 said:
> 
> 
> > JohnG @ Mon Oct 13 said:
> ...



"sudo" as in "superuser do", command to do things that needs root access without loging in as root. Same in all Unix systems.


----------



## Dracarys (Oct 14, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*

Sorry for the confusion, I'm having this issue on Windows AND Mavericks on my laptop. Luckily OSX has the "sudo purge" which I use all the time switching in between sessions.

Surely there is an equivalent for Windows OS?

Memory leak? The ram does not go back to normal after a while, maybe just couple GB's. 

I'm running Cubase 6.0.7, 64x. Pretty sure when I had the Cubase 7 trial I had the same issue.


----------



## proxima (Oct 14, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*



Casalena @ Tue Oct 14 said:


> Sorry for the confusion, I'm having this issue on Windows AND Mavericks on my laptop. Luckily OSX has the "sudo purge" which I use all the time switching in between sessions.
> 
> Surely there is an equivalent for Windows OS?
> 
> ...


Be careful with interpreting "free" memory on Windows and Mac. Disk caches, where the operating system stores a portion of what's on your hard drive/SSD in memory for faster access, are totally normal and will by default fill your available free RAM. When an actual application needs memory, it's available.

You should not be running "purge" as a matter of course. Sure, this will free up your disk cache, but for no benefit to your actual applications.

Even if an application has a memory leak, closing and re-opening the entire application should free up the RAM. The operating system tracks the RAM requested by the application, and even if the application itself doesn't clean up after itself, the operating system will (which is to say, will allow other applications to use the RAM).


----------



## EastWest Lurker (Oct 14, 2014)

Exactly. The whole memory compression scheme in Mavericks is very complex and confusing and what you see in Activity Monitor can be misleading, but it actually works better than its predecessors.


----------



## proxima (Oct 14, 2014)

EastWest Lurker @ Tue Oct 14 said:


> Exactly. The whole memory cop-ression scheme in Mavericks is very complex and confusing and what you see in Activity Monitor can be misleading, but it actually works better than its predecessors.


Disk caching predates Mavericks, but agreed, memory compression can add another layer of confusion, because if you start to reach full memory Mavericks can add compression to the memory used by inactive applications to free up more memory.


----------



## Dracarys (Oct 14, 2014)

The main difference between my Mac and Windows issue, is that Mavericks actually replaces the RAM, at least that's how it feels performance wise, I probably don't have to sudo purge, I just do anyways. Like J said, Mavericks disk utility is not very accurate, I'm always utilizing a shit ton of ram, Mountain Lion seemed to give me way less issues.

With Windows, the ram keeps stacking, and I get clicks and pops as if I'm running out of space. Closing application doesn't solve anything, only restarting.

Another weird thing on my Mac Laptop, is that after closing cubase, the Kontakt or PLAY Memory Server is visible at the top of my Mavericks Tray, but when I select purge that way, it only gets rid of some of the RAM from the session, but I'm still stuck at like 10gbs. 

Anyway it isn't application specific, doesn't matter if I loaded the samples through PLAY or Kontakt windows task manager thinks lots of ram is utilized.

Maybe it's just my shitty, discontinued motherboard GA UD5 X79. Do I really need to buy an entire new rig, maybe I should just splurge on PCIe ssds, Haswell-e 8core, etc. Yeah, that will do it


----------



## proxima (Oct 14, 2014)

Casalena @ Tue Oct 14 said:


> Anyway it isn't application specific, doesn't matter if I loaded the samples through PLAY or Kontakt windows task manager thinks lots of ram is utilized.


Use resource manager, not task manager, and look at the green part of the memory bar. Also, on task manager, you definitely need to add "cached" and "available' together to get some sense of free memory (cached being the operating system disk cache).

It's entirely possible that your system has other issues which are fixed with a reboot. My point is that you shouldn't assume they're RAM related.


----------



## Dracarys (Oct 16, 2014)

Resource "Monitor" reads the same. It's definitely application related, since my memory has worked normally in the past. Not not sure how to isolate the problem, I'm trying this "memory leak" program to see which application may be the culprit, but it's a bit complicated atm.

All I know is that I can have 5gb worth of samples loaded in Kontakt, yet Resource Monitor will display, much more. Pre load buffer is off.

Also, can somebody tell me how to turn Memory Server off using PLAY? I'd like to see if East West poses the same problem, but I need to load the sample entirely into RAM.


----------



## Michael K. Bain (Oct 16, 2014)

MaxMem for Windows has a "memory freeing" function. It works well, I've used it for years.
http://download.cnet.com/MaxMem/3000-18512_4-12123.html


----------



## marclawsonmusic (Oct 16, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*



proxima @ Tue Oct 14 said:


> Even if an application has a memory leak, closing and re-opening the entire application should free up the RAM. The operating system tracks the RAM requested by the application, and even if the application itself doesn't clean up after itself, the operating system will (which is to say, will allow other applications to use the RAM).


This is not entirely true. It depends on the language the app was written in. For example, Java and .NET runtime languages both have built-in garbage collection, so even if the program doesn't release the memory, the runtime engine will.

Lower-level languages like C++ (which VEP and probably Kontakt / Play are written in) are not as forgiving. If the program does not release the memory, it will remain locked from the OS. Think about it... The OS cannot use memory that has been allocated to an application because the app expects it to be there - the app would be like "where's mah memreh?!" (or in Mac terms 'the application quit unexpectedly').

So, if a program written in C++ does not release memory back to the OS before it shuts down, you will see this exact behavior. There is some amount of memory "left over", each time the application runs, and over time the computer will actually run out of memory. This is how the term 'memory leak' came about.

Back to the OP... You might be able to run a simple test to determine the source of the problem. For example, if you suspect this only happens with Kontakt - you could create a new project in your DAW, load a big Kontakt multi, check RAM, then close the project. If there is extra RAM, you have a very simple repeatable scenario.

Once you have something repeatable, you can report it to the developer.


----------



## proxima (Oct 16, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*



marclawsonmusic @ Thu Oct 16 said:


> proxima @ Tue Oct 14 said:
> 
> 
> > Even if an application has a memory leak, closing and re-opening the entire application should free up the RAM. The operating system tracks the RAM requested by the application, and even if the application itself doesn't clean up after itself, the operating system will (which is to say, will allow other applications to use the RAM).
> ...


No: what I described does not depend on the language used to write the application. I said if you completely close and re-open the _entire_ application (rather than closing a window, for example), the memory is freed up. See this:

http://stackoverflow.com/questions/4149 ... emory-leak

If the application closes, the OS releases all of the memory allocated to that application, regardless of whether the application cleaned up after itself. Memory leaks are about programs that run persistently. Garbage collectors clean up objects in currently running programs.

I'm pretty sure we both agree, but you didn't read that I carefully stated that memory leaks are cleared up if you completely close and re-open the application. For our purposes, this means the entire DAW (and closing or not using any persistently running programs like VEP or, perhaps, the Kontakt memory server).


----------



## marclawsonmusic (Oct 17, 2014)

*Re: Is there seriously no way to 'Sudo Purge' memory on Windows?*

Hey proxima,

Your point is valid. Modern OSes do release memory when an application terminates. It was not always this way (my age is showing!), and the OP's scenario is a classic case I've seen before with unmanaged code on older OSes. I guess I had a flashback. :oops: 

That said, I still find it odd that memory was not released when the application(s) were closed. This is probably a good time to point out the difference between an application 'closing' (meaning the window shuts down), versus the application's process 'terminating'.

Casalena, are you familiar with Task Manager in Windows? When this problem occurs, you might want to check the 'Processes' tab (or 'Details' tab in Windows 8 ) in Task Manager. This will show a list of all running processes on your computer. (*NOTE - in Windows 7, you have to click 'Show processes from all users' to get a complete picture). If you see anything in the list related to Kontakt, Play, VEPro or <your_DAW>, you can 'End Process' (or 'End Task' in Windows 8 ). If this frees up the 'missing' memory, you've found your culprit.

Hope this helps,
Marc


----------



## Dracarys (Oct 17, 2014)

Percy Faith Fan @ Thu Oct 16 said:


> MaxMem for Windows has a "memory freeing" function. It works well, I've used it for years.
> http://download.cnet.com/MaxMem/3000-18512_4-12123.html



I don't see the option anywhere, does it actually clear ram? All I see are other options that don't offer a purge of any sort


----------



## Dracarys (Oct 17, 2014)

It seems this is a common error people are having

http://www.steinberg.net/forums/viewtop ... 19&t=20611


----------



## Michael K. Bain (Oct 18, 2014)

Casalena @ Sat Oct 18 said:


> Percy Faith Fan @ Thu Oct 16 said:
> 
> 
> > MaxMem for Windows has a "memory freeing" function. It works well, I've used it for years.
> ...



It has right-click "freeing"function.

This ha a bit more info on the freeing function:

http://www.softpedia.com/get/Tweak/Memo ... xMem.shtml


----------



## Dracarys (Oct 20, 2014)

I'll give it another try tomorrow, pretty sure I selected everything possible with no clear


----------



## Dracarys (Oct 20, 2014)

Percy Faith Fan @ Sat Oct 18 said:


> Casalena @ Sat Oct 18 said:
> 
> 
> > Percy Faith Fan @ Thu Oct 16 said:
> ...




I gave it another try, the first time Cubase actually purged all ram, every time after that it was back to normal, 15gb session, 10gb remaining after close. You're supposed to run it before a session, or at startup, I was under impression there was a "clear" option.

If I load another session it will goto 20gb in task manager. It's very random and not always mathematically logical. When big sessions are open, I notice that samples don't always overlap and replace one another, sometimes it adds to task manager, other times it's normal.


----------



## Michael K. Bain (Oct 22, 2014)

Casalena @ Mon Oct 20 said:


> I gave it another try, the first time Cubase actually purged all ram, every time after that it was back to normal, 15gb session, 10gb remaining after close. You're supposed to run it before a session, or at startup, I was under impression there was a "clear" option..


I have an older version, and it does have a clearing/freeing function, available from the right-click menu. I guess they took it out of more recent versions.

If I can find the install file, Ill get my version to you.


----------



## Dracarys (Oct 23, 2014)

Please do, I just used the softpedia link you posted, thanks!


----------

