Large Max patches = RAM hogs?
First off, I am not the most proficient of Max programmers, so please take it easy on me.
I have a fairly large patch (~100MB). It is not doing any audio at all, just simple midi and some OSC handling. When checking the performance of the patch, to my surprise I discovered that it uses a significant amount of RAM >~750MB physical and >1GB virtual!!!
I contacted support about this and they told me that removing any graphical interface objects (sliders, etc), would help. I have gone ahead and removed most of the slider and buttons, but still, RAM usage only dropped ~30MB.
Do you guys find that with large projects, Max uses a lot of RAM? Do you have any advice for improving performance? Are there any particular objects which I should avoid? What techniques help with RAM management?
Thanks in advance.
not sure, I think the RAM issue is more about what files you might be using like video or audio that are put into RAM (like buffer~ instead of sfplay~, or using "loadram" to jit.qt.movie).
Objects to avoid, well, it would be great to get a list of guidelines for that, for sure. Some functions/filters/FX are a lot more CPU-intensive than others, don’t know how the RAM factors into this.
A 100 MB patch sounds totally crazy…my biggest ever (well, I thought it was big :) was only about 5 MB. You can rack up a lot of MB by having embedded images, but most of the other objects are really quite small…not sure how you’re getting to that rather massive size?
a 100 mb patch? biggest ever! :). there is probably something wrong with it, for
example you might have included picture files unintended or something like that.
you also might need to learn how to build and use abstractions.
i have never found maxmsp to use much RAM. the only problam with RAM can
be that when you open and close hundreds of big patches with namespaces
it can make your machine slower after a while because those will remain in RAM
after you close the patch.that can also happen to audio buffers, under circumstances.
the only thing what requires noticable amounts of RAM should be audio, video and
GUI stuff (when bigger, uncompressed pictures files come to play)
Roman: I have been paid to work on a patch considerably larger than 100Mb, and Gyre, my step-sequencer on steroids weighs in at about 75 Mb.
As far as I can tell, there are no audio files,no image files, and no videos used in the patch.
I used to have lots of sliders and buttons, but I got rid of them. The size of the patch has not decreased much and the RAM usage has dropped only ~30-40MB.
The most used objects are quite simple, nothing fancy at all. Lots of MIDI In and Out objects (both note and ctl), message objects, gate, route, send and receive, etc. Quite simple bread and butter type of stuff, actually.
There are a lot of subpatchers within the main patch. Not sure if that has an impact. Also, I must learn about abstraction, but I am not sure how it is going to help with the RAM usage.
@ Chris: out of curiosity, how much RAM does your Gyre step sequencer use?
Thanks to all for your inputs.
I’m not sure how I would go about measuring such a thing to any degree of accuracy.
A fresh launch of Max, with no patcher open gives me 42.9 MB Real, 1.01 GB Virtual.
With Gyre loaded, I have 451.4 MB Real, 1.42 GB Virtual.
This was using Activity Monitor.
Note that some parts of Gyre are only loaded when requested, so these numbers are probably down a little from where they could be.
Just curious, I have some patches that I know I could optimize. What is a good object so substitute for the gain~ slider? I mostly use gain~ to make things louder and don’t actually ever use the slider. There must me a more basic way to make things louder. thanks
is this what you mean?
----------begin_max5_patcher---------- 668.3oc0W1saaCBEG+ZWo9Nf3xptH.+Qb1c64XpZhXSRXCCVw3slVM+rOLX6 j1trZmZ6ncSHb.C+O+NbNX+7s23AWqdjU.AeF7Ufm2yFKdVa0V7ZM3AynOlH nE1IBSTYYLoFdeyfZ1iZ6.7MfCpRfRJN.jLVJPq.ELMfBnY4feREkLfT4FZi ZuwdgfmxL+wLGgXQ2JJ3RVhpTZWV+VqaTRcA+IVsQLYAp0trLSUpELsUdcly o5jcb41usmkncdHIx27X.rOx1DZaBhWf.Ob5lHoY1MA9k8bpnSU7TqQ05u+I hO7jcmKa2br03uu8l5VSy8ebnRA6Y4BZBqdXK1z6XfsTtrpAe+crQFOrg8iq Ak+JK0vg1NAW.0viM0XOkRSpfWvIgXqKQBs9TPX6uGcoSzM9LQaxEqaI6WlE 9sA6jCIBVEffPvgE9vuuuhiipahbNN5Te0sP5C4L2S.K3aklX3PCv3f4BT2U APK7GeHQHtZBjIDRqFaHcwYA3flrfk8IK.+ecVPiuFil7j.zXyoMBkYk5VUy X7LS+5f6QRzOBQ9WDJh3JvaabWN9NHxnLp4NK.bMUtcvj5XhfASstjgenWn9 w3dhycRq9FyJ33ivXaBkeT+OkcoLLZtRJyoI+vbdCfG2rxFf4ZV52CfMXDEN WHJcsVQm.336JOimB3D.moTs6pF+h4Dr6ESIKBmrp486viaYs0Sd8WSYke8. uhZEpx8Ispq8EC.m3BorBMWR0bk7zYYdqG.93r1wSSYxWbSeFOMWwk5FkPVs zxmPrCV9c8.Ob9v7THazPj83HtfdItUWEwE1GsEcUjVTuv1POINNgzdIsAqM bnKKIv8Utw9c8lYUeERRP8MZO+ZqWEWBtJRqWkVB+vRq1fo4OL21ZI. -----------end_max5_patcher-----------
Yeah that’s what I mean Grizzle, Thank you. I’ve tried that before and it always seems that gain~ slider is louder than the *~ object at 1. Maybe it’s just my imagination. I’ll try that out. thanks.
The gain~ slider has about 20 db of gain. 0 db on the gain~ slider is at 127, and it goes to 150-something.