Forums > MaxMSP

Allocating more memory to MAX?

February 28, 2012 | 3:49 am

I’m running max 5.1.9 on windows. I know max 5 is not 64 bit (max 6 ish’t either, correct?) but isn’t there a way to allocate more memory to 32 bit apps? I can’t track it down….

I’m loading quite a few vsts and therefore running out of memory. But I have 8 gb in my machine…

Thanks for any tips.
-eric


February 28, 2012 | 7:46 am

Okay, I’ve done more reading, and it looks like a 32-bit app running in a 64-bit windows OS will be allocated up to 4 GB of RAM, as long as the app is LARGE_ADDRESS_AWARE

So, I’m wondering–Is Max 5 not large address aware? Is Max 6?


February 28, 2012 | 8:13 am

How do you know that Max 5 is not large address aware?
On a mac I manage to smoothly run patches which allocate 3.6 gb in memory, including the program (if you go higher it will become tricky, say 3.7=tricky, 3.8= dangereous, 3.9=about to crash).
I don’t know how it will behave on a pc.


February 28, 2012 | 8:41 am

On my PC it is crashing at 1 GB! I am running Windows 7 64-Bit with 8 GB RAM

Is there some flag I need to set when starting MAX?


February 28, 2012 | 8:46 am

no argument to set.
1 gb of what? how do you check the memory usage?
Don’t look at the current used physical memory, you need the total of reserved memory for that program, the virtual memory usage of the entire process. (I know it took me some time to know where to look at, but that’s on the mac, I don’t know it for windows)
keep in mind that for example audiofiles take up twice as much space when they are loaded (16->32 bit conversion)


February 28, 2012 | 9:28 am

How do you allocate, Timo? In max preferences? Thanks


February 28, 2012 | 9:37 am

no, I don’t allocate myself, I check how much memory is allocated using the following patch:

– Pasted Max Patch, click to expand. –

you need the [shell] external to run this http://cycling74.com/toolbox/bernstein-shell/, and sorry, it’s mac only


February 28, 2012 | 9:55 am

Works with Max 6 also? Thanks again.(MAC ok ;>)


February 28, 2012 | 9:58 am

yup, works with max 6 (that’s why I check the maxversion of the patch, since the process name has changed in max 6)



pid
February 28, 2012 | 10:22 am

as i understand it,

max5 on windows or mac, 32 or 64 bit, up to 2gb ram usage.
max6.0.2 or later on windows 64-bit, up to 4gb ram usage, but on mac, 32 or 64, still only 2gb ram usage.


February 28, 2012 | 10:24 am

nope… this is not true (at least not what i have experienced), I use patches above 3.5gb memory use in max 5 on a mac which work fine

of course it also depends on what memory indicator you look at


February 29, 2012 | 1:05 am

Hmmm. Well, I wonder why I’m getting the message "the application is out of memory and may become unstable" when the taskmanager shows the Max application using 1.15 GB of ram. I should have at least another gig available.

I’m running 4 instances of Kontakt, and 3 of reaktor. I can run 25 instances of Kontakt in Reaper. That’s where I stopped adding tracks, not the limit per se…. I know samples take up ram, but only one instance of Kontakt loads samples, about 300mb worth according to Kontakt’s UI.

I am not loading any samples into Reaktor.


January 24, 2013 | 3:34 pm

It seems this topic was left unsolved…
I experienced the same kind of problem here.

Test patch was the following : create a dozen of buffers and load them with some 300Mb soundfiles.
When reaching about 2 or 2.5Gb memory usage (as measured by OSX activity monitor), a message is kindly send to the max window to warn about memory limit : "buffer~: u809000206: out of memory reading my_3000mb_soudnfile.wav"

If at this point, on starts to instantiate savagely graphical user interface (say a swatch for example), on eventually gets a crash.
(See crash report at the end)

Tests were made with Max5.1.9 and Max6.0.8 on the following systems :
- imac Intel Core i5 3.6 GHz – OSX 10.6.8 – RAM 8Go 1333 Mhz DDR3
- macbook pro 2.8Ghz Core 2 Duo – OSX 10.7.2 – 4Gb RAM
- macbook pro Core-i7 – OSX 10.8.2 – 8Gb RAM

The question are :
- how to avoid the crash ? ( something like preventing a user from creating more interface and warning him/her with a message in max console would be utterly great — just like the buffer~ does)
- how to overcome this (pretty smal) memory limitation ?

Warning : pasted below is *not* a Max5 patcher, but the crash report, just to spare viewport… is there any markup for that ?

– Pasted Max Patch, click to expand. –

January 24, 2013 | 5:51 pm

Mixing Windows and OS X together in this thread almost certainly isn’t helping to re/solve the issue.

Although they’re not very different on many levels their memory management policies, implementation and reporting are certainly divergent enough to warrant separate investigation.

Getting an accurate picture of memory usage in Windows (at least < 8) requires knowing where to look, what to look for, and then adding up some from these piles over here, subtract a bit from that pile over there . . . you get the idea. It's not as simple as looking in Task Manager.

The large_address_aware flag will net you 3GB of Virtual Address Space in 32bit Windows.

To enable the 3GB switch on Windows 7:

Right-click Command Prompt in the Accessories program group of the Start menu. Click Run as Administrator.
At the command prompt, enter "bcdedit /set IncreaseUserVa 3072"
Restart the computer.

To disable the 3GB switch:

Right-click on Command Prompt in the Accessories program group of the Start menu. Click Run as Administrator.
At the command prompt, enter "bcdedit /deletevalue IncreaseUserVa"
Restart the computer.


January 25, 2013 | 2:19 am

^ The above message brought to you by:

poly~ sounding_much_more_pompous_and_authoratative_than_i_meant_to


January 25, 2013 | 9:32 am

I thought the topic "Allocating more memory to MAX?" (not mentionning the window filesystem AFAICT) seemed like a related topic to the problem I raised in the last post… C74 fellows, please let me know if this is actually a completely unrelated issue preventing you from resolving this bug (!) as I do no mind so much starting a new thread… :)

It also seems to me like the filesystem settings are not the only place where to improve/fix this issue. Max could maybe prevent crash to occur by scanning memory ressources (whatever way you get them depending on platform) and warn the user accordingly, preferably in a "platform-independant" way… as I expect as much as possible that Max behaviour remains the same whatever system I decide to use.

Thanks for the info concerning window platform, that is precious. If anyone know an equivalent alternative for OSX, or even just a clear explanation about what is happening (and how to prevent the crash, which are eventually my main concern) this would be super welcome.



pid
January 25, 2013 | 10:48 am

or just wait a couple months until Max 6.1 is out, which is 64-bit.


January 25, 2013 | 10:51 am

i would be very pleased if this release fix the crash issue indeed… not sure the fact that it is 64bit will ensure that though :)


January 25, 2013 | 1:29 pm

Will the 64-bit version of Max (OS X version) be able to handle 32-bit VSTs?


January 25, 2013 | 2:00 pm

ok dhjdhjdhj, my turn to tell you that your post may be slightly off topic … :)

FWIW, I think you may find the answer to your question here.

And by the way, I found some "official" apple statement on how much memory should be available in 64bit:

64-bit computing shatters the 4 GB barrier of 32-bit computing by enabling applications to address a theoretical 16 billion gigabytes of memory, or 16 exabytes."

Still, this does not prevent my Max from crashing …
Maybe any "official" statement from C74 on this memory topic soon ?


January 25, 2013 | 3:34 pm

Hey Vincent – I wasn’t telling you your post was off-topic, my post wasn’t aimed at you at all. I will tell you that the "filesystem"* (on OS X or Windows) has nothing to do with anything though! ;)

* HFS+ and NTFS respectively. Not related to virtual addressing or physical memory.

I was just trying to point out that when it comes to this subject, it’s not always wise to treat Windows and OS X interchangeably. They even handle the 32bit / 64bit differently (from each other).

That blurb on the Apple Developer page reads like breathless marketing fluff – "OMG 64BIT FASTAR!!!". I thought they limited that sort of guff to the hordes?

64bit won’t fix memory leaks, but the machine should stay up a bit longer. :D


January 25, 2013 | 4:04 pm

agreed with the marketing smell of apple statement, thats why apple says a *theoretical* 16 billion gigabytes… and why I said *should* be available :)
About memory leaks mysteries, I bet we’ll soon discover it is related to some quantum mechanics anti-matter unsolvable equation.


January 25, 2013 | 5:23 pm

With something as extensible as Max, memory leaks could reside in 3rd-party externals.

The Apple blurb is about as non-technical a take on the whole 64bit thing as I’ve seen in many a year – and this is probably fine for a lot of the intended audience there (developers) as they ought to be able to smell it for what it is. My problem with the preceeding statement is that it seems Apple know full well that many non-technical people are ending up there . . . at the very least it’s a likely landing-page for those just starting out, perhaps their first hobbyist ObjC or iApp project.

So, nothing like starting people out on the (technically correct but fundamentally meaningless) good foot eh?

All of this is fairly off-topic now I think so I’ll quit here.


January 25, 2013 | 5:54 pm

or just wait a couple months until Max 6.1 is out, which is 64-bit.

Wow! That would be so amazing that I actually can’t believe that it would happen. Is there some (un)official statement about a 64 bit version of Max 6.1? I’ve never heard about that before…

Thanks,
Ádám


January 25, 2013 | 7:49 pm

With something as extensible as Max, memory leaks could reside in 3rd-party externals.

in the example I first mentionned, I used only buffer~ and swatch, which are native Max object.
So the issue seems to dwell in C74 hands…


January 25, 2013 | 8:33 pm

True, but I am speaking to the point broadly – not specifically addressing your issue.



pid
January 25, 2013 | 8:56 pm

@ adam siska, it has been very publically released as part of the Live9 Beta program, which is why i thought it was fine to mention it. Max will be 64 bit because Live will be 64 bit.

@ vincent etc, i think it is you who hijacked this topic. for your unrelated issue you should start a new topic.

@ dhjblahblah, my perception is that i am almost 100% sure that no, there will be no magical 32/64 bit bridge for vst~ etc. but i could be wrong. there is none in Live9 either.


January 25, 2013 | 9:06 pm

@ pid re: The Great Thread Hijack Of ’13 . . .

Yeah – he did just a bit didn’t he? :D

Vincent – just reread your first post in this topic. You deliberately exhausted the physical RAM in your machine and you’re blaming the software for instability? No offence pal, but PEBKAC. :P

Graphical glitching is probably the most common symptom of out-of-resources issues (which is not limited to just RAM, but for instance things like GDI Resources on Windows – I know little about the specifics of OS X’ architecture at that level).


January 25, 2013 | 11:42 pm

ok, started another topic here
Sorry if you felt it confusing the original topic of this thread, not intended.


January 26, 2013 | 3:34 am

Oooof! Nearly hijacked vincent’s newly created topic with Crazy Talk – but his concerns got me thinking about ways to alleviate VAS and physical RAM usage under 32bit Windows and I believe I may have a solution.

Or a workaround.

Or a hack – but let’s not let semantic niggles get between us and moar gigabytes.

Address Windowing Extensions (AWE)
Physical Address Extensions (PAE)

http://msdn.microsoft.com/en-us/library/windows/desktop/aa366796%28v=vs.85%29.aspx

Intrepid Maxers, step this way . . .

http://www.bcastell.com/tech-articles/enabling-more-than-4-gb-of-ram-under-windows-7-32-bit/

As these things go, that looks relatively benign. I would think the only potential limiter to (ab)using PAE for the purpose might be that perennial fly in the ointment – drivers.

So if anything in the toolchain is likely to keep you stuck on 32bit for a while – have at it.


January 26, 2013 | 8:41 am

You’ll just have to use Max 6.1 in 64 bits mode. Max is currently a 32 bits app, therefore you can’t use more than 2/3 GB of RAM. The real limit is hard to say because of memory fragmentation: if you open a patcher with some big buffer, remove some objects, do other stuff and try to reinstantiate the buffer~, you can’t be certain that there still going to be enough continuous memory to hold those buffer~.


January 26, 2013 | 4:38 pm

Hi Emmanuel.

I was going to ask if Max handled its own garbage collection or relied on that supplied by the OS actually.

But yes, contiguous blocks of VAS or RAM may be hard to come by in the Max environment once it’s been up and in-use for a while in the manner you specified.

However, the methods I started to outline above should help, to wit:

If your BIOS and chipset support extra RAM above 4GB – PAE allows you to make use of this RAM . . . each process on the machine is still constrained to 2-3GB of VAS but this will be backed by more physical RAM.

The other part of the technique is to spin some of your Max project out to Standalones so they run in a different process . . . if your project is amenable.

So, to recap . . . PAE (with the AWE) can allow you to use more than 4GB of RAM, the per-process VAS limits remain but are vastly alleviated by being backed by a larger pool of RAM. Spin more processes to grab more VAS.

Make sense?


January 26, 2013 | 6:45 pm

I should add, for those who didn’t click through this link:

http://www.bcastell.com/tech-articles/enabling-more-than-4-gb-of-ram-under-windows-7-32-bit/

This requires busting out a hex editor and modifying your Windows kernel. It’s not particularly hard (step by step instructions), and the method to booting this modified kernel is clean, selectable and immediately reversible – therefore pretty safe to experiment with.


January 26, 2013 | 8:22 pm

I believe you should end up with 4GB of address space per process, not the default 2GB as per the usual split, or 3GB with the switch thrown – but I’m unsure about this point without digging into it further.


February 24, 2013 | 5:48 pm

Hi to ALL !
One application in 32 bit systems can take only up to 2GB for one process.
This info You can see in Procexp – alternative task manager http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
In the top of table – right click -> select columns -> Virtual size
And NOW You can see the moment of crashing Yours application if reached 2048K !!!


Viewing 35 posts - 1 through 35 (of 35 total)