# Kontakt problem. Help.



## Dan Selby (May 3, 2006)

Hi,

Can anyone confirm this bug or set me straight if I'm just being dim?

Purge doesn't bloody work. Using Cubase SX3 (latest version) on PC and this problem affects Kontakt 2.1 as well as 2.01.

Test:

1. Load Kontakt into an instrument slot in Cubase. Open Task Manager and note the RAM usage ("PF Usage").

2. Load a big multi or a load of instruments. Note the "PF Usage" in Task Manager.

3. "Purge All Samples" in Kontakt. The RAM figure *in Kontakt* drops to zero, as you would expect. BUT...

Result (for me): the PF Usage barely drops at all. :cry: 

Grrr. 

Can anyone please confirm this bug or tell me if I've missed something obvious - thanks! 

Workaround:

If you go to Options in Kontakt and tick the box that loads instruments already purged then this cures the problem. You can then reload all the samples and when you purge again, this time the RAM is actually released as it is supposed to and you can reload and purge as intended.

This is a pain, though, as you *have* to always work with Kontakt in this mode in order for purge to work... which means you have to reload all samples (and wait) after everytime you load a Cubase template or load a Kontakt multi, bank or instrument.


----------



## sbkp (May 3, 2006)

I don't even have PF Usage in my Task Manager. So I can't test what you're testing. But in my experience, Mem Usage and VM Size definitely go down. And I just tried it again to confirm.

PF usually means "Page Faults", so "PF Usage" doesn't really make sense to me.


----------



## Dan Selby (May 3, 2006)

That's for checking this out. I am looking at the performance tab on Windows Task Manager (Ctrl Alt Del) on XP Pro (so we're on the same page). I'm pretty sure that PF Usage is RAM (not page file or page faults).

Also, I have confirmed that memory is definitely NOT being properly released (here) by:

1. Loading a large multi into Kontakt2 and then purging all the samples. My PF Usage was showing about 1.3 gig and didn't drop when I purged the samples

2. Opened an instance of Stylus RMX and tried to open a big multi in RMX...

... I get the "out of memory" message in Stylus RMX

But if I repeat this test but *first set Kontakt2 to "Load instruments / banks / multis in "purged mode"*, the PF Usage drops to 600meg and I can then load multiple instances of Stylus RMX with multis loaded with no "out of memory" messages and no problems.


----------



## José Herring (May 3, 2006)

Hey Dan,

I did some quick research on PF usage and I think you may be confusing two things.

PF usage deals with memory addressing and it looks like it's not necessarily connected with physical ram.

So, when you load your samples up it loads to physical ram and then allows for some space to be allocated in virtual memory. Maybe that's the buffer that everybody keeps talking about, I don't know.

So when you purge you may be purging samples from Ram but it may still leave the Virtual memory addressing available.

Try saving your purged instance of K2 and restarting your computer. Then see if the PF usage goes down.

Like I said it's a bit of a mystery to me still. And, I'd probably need to do like an hour of research rather than 5 min. to get a full answer for you. I may do that because in the past I noticed that if the PF usage got up to 1.4gigs then Cubase would crash, but once I purged the samples and was able to get up to about 1.7gigs which leads me to beleive that PF usage and physical memory my not be the same thing.


----------



## sbkp (May 3, 2006)

Ooohhhhhhhhhhhhhhhhhh.... 

PF Usage is "Page File Usage" (see "Page File Usage History" to the right).

I'll watch mine and see if it ever goes down.

Click on the "Processes" tab, then go to the View > Select Columns menu. I have selected CPU Usage, CPU Time, Memory Usage, User Name, and Virtual Memory Size.

That doesn't solve the problem with RMX running out of memory, though. That sucks for sure.

EDIT: Okay, actually my PF Usage went down. But one time (I think) it didn't go down until I closed the K2 window within Cubase (SX 3.1 here, too). But I haven't replicated that. Want to give that a try (if you haven't already)?


----------



## Dan Selby (May 3, 2006)

Thanks Jose, thanks Stefan.

It is confusing. I will try and work out what's happening. The fact remains though that if I start Kontakt with "Load instruments / banks / multis in "purged mode" before loading my kontakt instruments/multi I can load MUCH more in the way of Stylus RMX instances and patches than if I were to load Kontakt in "normal" mode, load my multi, purge all samples and then try to load Stylus.

I haven't tested yet if this is the case if I try to load VST instruments or effects other than Stylus - up till now I had assumed that it would be because the PF Usage behaves differently depending on what "mode" you have Kontakt set to.

If either of you can repeat my findings that would be great. Load a ton of stuff into Kontakt so you know it's used most of your RAM - to the point not far short of where your system would usually become unstable or you would run out of RAM. Then, purge all the samples and then start loading other VSTis or effects until Cubase falls over or you get some other demonstrable evidence that you have hit your RAM limit. 

Then try the same thing but set up Kontakt first so that "Load instruments / banks / multis in "purged mode" is ticked and see if you are able to load more stuff afterwards... (or if it's just me :( )

Cheers,

Dan


----------



## Dan Selby (May 4, 2006)

Okay, a simple repeatable test that (I believe) shows that, on my system, RAM is NOT being released by using Purge UNLESS Kontakt2 is configured with "Load instruments / banks / multis in "purged mode" checked.

1. Load Cubase SX3. Do not create a new project or load a project.

2. Load Windows Task Manager (Ctrl Alt Del), go to the Processes tab, find the "Cubasesx3.exe" line and note the "Mem Usage". If the Mem Usage column isn't displayed go to View, Select Columns and tick the Mem Usage box.

3. In Cubase, Press F11 to open the Instruments rack. Load Kontakt2 into the first slot. At this point my Mem Usage for Cubasesx3.exe shows 174,172K.

4. Click the Options in Kontakt2, go to the "Load / Import" tab and make sure that the "Load instruments / banks / multis in "purged mode" option is NOT ticked, then close the Options tab.

5. In the Kontakt2 browser find the "AF Full Conv (high cpu) + Rel.nkm" multi from the Kontakt2 library - in "03 - Grand Pianos", subfolder "02 August Foerster". Load this multi.

6. At this point take a note of Mem Usage for Cubasesx3.exe - mine showed: 296,344K

7. In Kontakt2, press "purge all samples".

8. Take a note now of Mem Usage - mine showed: 290,064K

So *only 6,280K* was released by purging the samples.

Close down Cubase.

Now repeat steps 1 to 8 only this time at step 4, make sure that "Load instruments / banks / multis in "purged mode" IS checked and at step 7 click "reload all samples"

This time, when I first load the piano multi my Mem Usage for Cubasesx3.exe in Task Manager shows: 236,620K and after I clicked "reload all samples" it showed 297,104K. If I then press Purge All Samples, Mem Usage drops back down to 237,456K.

So, this time *59,648K* was released by purging the samples!

This multi that comes with Kontakt2 is obviously only a pretty small multi - with my big orchestral multis this is a much bigger problem. For me, effectively, Purge is broken unless I always have Kontakt2 set to "Load instruments / banks / multis in "purged mode".

Can anyone run this test and let me know if you see the same problem or is it just me? Thanks! 

Dan


----------



## sbkp (May 4, 2006)

I see the same results here, even with the project I was using yesterday.

So WTF? Why did I see it working before?

After playing around a little while, I found that if I minimized and restored the Cubase window a few times, things changed quite a lot. The purge started having an effect, though not right away (!), and in general, the memory footprint was reduced. (From about 1.2GB to 740MB).

???????????????????


----------



## sbkp (May 4, 2006)

I noticed the same thing in K2 standalone:

Load K2: 124,592K
Load instrument (I don't have the multi you suggested): 270,204K
Purge: 261,952K
Minimize: 149,776K
Restore: 154,988K

Now, here's the weird part...

Reload samples: 171,564K

!!!!!

Free! Extra memory available in K2!

No, not really. Start playing and the memory usage starts to go back up (I'm not going to bother hitting every layer of every note, but it's back to 217MB now, and the VM size is still about 264MB. So I think that's just smoke and mirrors.

Anyway, maybe this minimize thing is the key. I still can't explain why I saw immediate results when purging samples yesterday.

EDIT: It doesn't seem that the page file usage gets any smaller, which makes sense, since the VM Size didn't change. So it might still run out of memory at the same point, even though Mem Usage has dropped.


----------



## Dan Selby (May 4, 2006)

Ha ha - interesting, Stefan! I hadn't even thought about trying Kontakt2 in standalone mode! And, yes, I get the same behaviour as you. When I purge, the Mem Usage barely moves - but when I minimize the RAM is released.

Problem is, I still cannot release the RAM by purging when Kontakt is loaded in Cubase...

... Scratch that! When I minimize *Cubase* the Mem Usage DOES drop!

Right - I'm going to try my Stylus RMX test again now! :D

Thanks Stefan!


----------



## Dan Selby (May 4, 2006)

Bollocks! :evil: 

Nope. Purge doesn't work. Minimizing Cubase releases the memory as shown on Mem Usage for Cubasesx3.exe but, crucially, as you said Stefan, the PF Usage does NOT drop. It is the PF Usage which seems to be the limiting factor.

If you are in "Load instruments / banks / multis in "purged mode" the PF Usage DOES DROP when you purge (after reloading)! You can reload all samples then purge then reload then purge - each time the PF Usage rises and drops.

Result:

If I start Kontakt in "normal" mode (so samples are loaded when you load an instrument or multi), load a very big multi then purge all samples, minimize and restore Cubase I was still only able to load *2 instances* of Stylus RMX before I ran out of memory.

If I start Kontatk in "Load instruments / banks / multis in "purged mode", load the same big multi, reload all samples then purge all samples I can go on to load *6 instances* of Stylus RMX!

Can you confirm this Stefan?

Bollocks. :(


----------



## sbkp (May 4, 2006)

I have a better idea. Since physical RAM usage use really did go down, try making your swap file bigger.  It might clobber your performance (so measure whatever you can), but it might allow you to do what you need.

I'll try to do a more elaborate test as you suggested, but later... Real life beckons.


----------



## Dan Selby (May 5, 2006)

Increacing the swap file doesn't make any difference. :( ...

Guess I'll just have to resign myself to working in "load already purged" mode (which is a pain) until Native Instruments fix the purge feature so it actually does what it's supposed to.


----------



## Dan Selby (May 9, 2006)

Good news. I heard back from NI. The bug was confirmed and has now been fixed for the next update. 

Hopefully, in the not too distant future, Purge will work, then.


----------



## kotori (May 9, 2006)

Good news indeed. Thanks for letting us know Dan!


----------



## sbkp (May 9, 2006)

Good news, indeed.

So their initial testing process must have gone like this:

1. Click on "Purge all samples"
2. Play a note (no audio)
3. Look at the little red graphic indicating the samples are purged. Is it red? (yes)

Ship it!


----------



## Dan Selby (Jun 2, 2006)

Yay! Purge finally works in the 2.1.1 update!


----------



## sbkp (Jun 2, 2006)

Excellent!


----------

