Vienna Symphonic Library Forum
Forum Statistics

196,728 users have contributed to 43,031 threads and 258,433 posts.

In the past 24 hours, we have 7 new thread(s), 14 new post(s) and 102 new user(s).

  • Memory usage under Mac Os X

    Hey there,

    I have a small question regarding memory usage under Mac Os X. As some of you already know, I'm using Intel Mac Mini (with 2GB of Ram) to load an orchestra section. Ram usage is thus critical in how much samples I can load withing these 2GB.

    I kinda noticed that the "Free Memory" status on the VI changed from time to time, and from instance to instance. Also, even though the Free Memory is down to 25Meg at one point, I am still able to load samples.

    I fired up the Activity Monitor, and I got that:

    <a href=http://vsl.co.at/upload/users/jerome_vi_memory_cm.png">

    Now, my questions...

    What kind of memory is the VI server using? For example, I see a "lot" of Inactive Memory - is that memory VI is able to use?

    Should the "Free Memory" status in the VI instance be the same as the Free Memory in the Mac OS X Status Monitor?

    When you load a sample, does it first use the memory from within the "Free Memory", and, if not available, then would eventually have to use memory from the Inactive Memory?

    What is the difference between Real Memory and Virtual Memory?

    I understand these questions might be a bit technical but I'd like to understand how Ram usage works with VI.

    Thanks for your help!!!

    Jerome

  • Hey Jerome:

    Yours are no "small" questions-- very thoughtful points you've made here. Thanks!

    I'm still sorting out just how OSX *really* uses memory, but am having a hard time finding anything but the very basic docs on it.

    Real memory is actual physical RAM. If you have 2GB of RAM, you are talking about 2 GB of real memory. Virtual memory is that data which, instead of being loaded immediately into RAM, is written on your hard drive in a special temporary location and is "paged in and out of" RAM only when that data is needed. OSX won't use all of the available RAM, but will load in a certain amount of data and leave some RAM open for other tasks. However OSX determines what data gets priority is a little beyond me, but virtual memory is the OS's way of having needed data "on deck", so to speak, to minimize HD seek times for that data.

    I'm still scratching my head about your other questions, but if I find any helpful links I'll post them here. For me, it's important to learn how OSX deals with this first before I'll ever full understand how VSL deals with OSX.

  • Could "Virtual Memory" = "Real Memory" + "Inactive Memory" reserved by that application?

    Jerome

  • This from Apple:

    Wired memory: This information can't be cached to disk, so it must stay in RAM. The amount depends on what applications you are using.

    Active memory: This information is currently in RAM and actively being used.

    Inactive memory: This information is no longer being used and has been cached to disk, but it will remain in RAM until another application needs the space. Leaving this information in RAM is to your advantage if you (or a client of your computer) come back to it later.

    Free memory: This memory is not being used.

    This means you shouldn't worry when the Free memory is low. The only time Free memory should be high is right after the computer starts up. As you use applications or services, memory is used and transitions to Inactive. Applications that need more memory will take from the Inactive, but the Inactive is there just in case you need it again. If the combination of Free and Inactive is very low, then you might need more memory.

    Now this from Plowman, who is asking newbie questions about VSTi's, so what does he know? I suspect OSX re-defines our samples as "inactive" according to computer-y rules, but for our intent and purposes, it's still loaded sample data.

  • I agree with your interpretation. But then, why would the VI GUI shows "25MB free" when what is relevant is how much free AND inactive memory you have on your computer?

    Jerome

  • last edited
    last edited

    @Jerome said:

    I agree with your interpretation. But then, why would the VI GUI shows "25MB free" when what is relevant is how much free AND inactive memory you have on your computer?

    Jerome



    Can't we get an answer here? I'm still wondering what the FREE RAM Display in VI has to do with the amount shown in the acitivity monitor…


    Thanks
    Const

  • although i'd consider this more to be a question for a dedicated OS X forum i'll try to explain as simple as possible (and why the ViennaInstruments might not always display an accurate number for *free* memory)
    - ahead you need to count 1 GB as 1024 MB, this will clear up some apparent rounding discepancy.
    - apple is calling *virtual memory* the sum of physical RAM plus the size of the pagefile (= memory *paged out* to a file on your harddisk), the word *page* originates from the term *memory-page* which handles data in blocks like pages in a book.
    - of course a (streaming) sample player can only use physical RAM, data located in the pagefile would need to be transferred to the physical RAM first which is slow and therefore useless for streaming.
    - apple is counting the used RAM as wired + active + inactive, where wired memory are *pages* which can in no case be moved to the pagefile (the example above shows this is more or less the sample headers stored by the VSL server)
    - active memory are pages which are currently in use (and therefore also in no case can be moved to the pagefile) by the system itself, your running applications, ect.
    - inactive memory are pages which have been formerly used (loaded) as wired or active but are currently no longer in use (unloaded samples, closed applications, ect) but OSX assume theymight be needed again in the near future and are therefore kept in (physical) RAM. this pages can be moved to the pagefile (if a running process requests additional RAM) or simply unloaded.
    - additionally there is memory used by kernel-tasks listed nowhere, even the related processes might not be listed (this is not too much so we ignore it here).

    hopefully this explains why it is sometimes hard for the VI to estimate how much memory now is really available, since the only thing it can do is request memory from the operating system *mentioning* it has to be physical RAM. only the OS itself can allocate memory and in an ideal situation the inactive memory is 0 (zero) and you have filled up everything with samples. clearly the OS cannot hand out all remaining *pages* to the VI, because otherwise a simple task from the system or a vital application calling and depending on physical RAM might have no memory left and the system could freeze or crash.

    hth, christian (typos edited)

    and remember: only a CRAY can run an endless loop in just three seconds.
  • I've been observing the exact same things on my Intel slave (and master G5 for that matter), and I too are scratching my head. [:'(]

  • And therefore the bottom line is that you just see how much you can load in what order before things become unstable or you get clicks and pops.

    Right? There isn't anything you can do to affect this as far as I know?

    ***

    Which brings up a question: if you have >4GB installed, the OS will use about 512MB plus any "extra" RAM for caching disk reads. How does "only" having 2GB affect the performance in that regard?

  • The question remains: For the best performances, should we stop loading samples once we the VI tells us "25 MB Free", or when the app is not stable anymore (± 3.25 GB on an 8GB computer)?

    Basically I've been wondering if, after a certain point, VI stops loading the samples in RAM and just "pre-load" them somehow - which would explain why some samples don't play immediately when they're being accessed for the first time.

    I'm trying to get the best performances out of VI, and I am puzzled (genuinely, I guess) when I see that I only have "25MB free" according to the VI info, but I can still load dozens of memory-hungry articulations.

    Jerome

  • such questions are hitting the level of OS X developers (and i mean developers of the operating system) because they touch low-level tasks like memory fragmentation/defragmentation and the rules if, how and how much the OS will assign memory to an application. clearly much depends also on other applications you are running on a system.

    probably there is also for OS X something like a memory monitor/spy but running such a tool would eat performance/ressources too and leave you again in a situation where performance on a maxed out system can only be estimated. cat bytes tail so to speak.

    it's almost impossible for the VI to tell you how much memory the OS will hand out or refuse to do so in a certain situation, you have to get the respective average values for your system and setup.
    christian

    and remember: only a CRAY can run an endless loop in just three seconds.
  • I don't see what harm you're going to do by loading it up until it complains. If it works, it works, no?

    3.25GB on a single machine [edit: a single *program& - sorry] is very good. 8GB G5s aren't happy with that much [edit: in a single program] - they crap out around 3GB [edit: or at least that's my experience].

    But that's for one program. 7GB on one machine is the real bottom line, and it's pretty damn impressive.