Disable win7 harddisk ram for a specific software

0

Sometimes when you ask matlab to create a very large array, it exceed actual ram and tries to go into harddisk, which slows down the computer so much that it becomes impossible to close matlab, only choice is to use the power button.

I want to disable only matlab's access to harddisk ram.

There are two related questions with nothing really that useful:

https://www.mathworks.com/matlabcentral/answers/34923-limiting-matlab-memory-usage

https://www.mathworks.com/matlabcentral/answers/231870-quitting-matlab-unresponsive-due-to-memory-maybe

grdgfgr

Posted 2015-07-31T11:05:06.820

Reputation: 523

Answers

0

Sometimes when you ask matlab to create a very large array, it exceeds actual ram and tries to go into harddisk, which slows down the computer

Uhh, sort off. What actually happens is that windows doees not assign RAM. It assign virtual address space (as you can see in the commit charge).

When it needs to use this asigned space it will try to use free RAM.
If there is no free RAM then it will try to free some. E.g. by writing some information from memory to the pagefile.

Tis is not an per application situation, but something with all memory usage on the system.

so much that it becomes impossible to close matlab, only choice is to use the power button.

The most likely problem here is that you have one application which triggers a lot of diskIO. That disk is shared by other applications and the OS. Which means that the OS also slows down.

Solutions:

  • Somehow limit matlab to have capped memory. Job objects might do the trick, though I never used it.
  • Or get much faster IO. (mitigates IO slow down).
  • or run matlab in a VM (you can limit the VMs memory).

Hennes

Posted 2015-07-31T11:05:06.820

Reputation: 60 739

I mean, I would be fine with just matlab crashing, as long as I can kill the process without the power button. The solutions you have written seem too difficult to me and I'm kinda mad at matlab because the hard disk ram schtick clearly doesnt work. – grdgfgr – 2015-07-31T14:58:10.470

>

  • Looks non trivial.
  • Is the same as @cybernards answer. (more generically formaulated).
  • A VM is what I would do.
  • Nice to have would be lower priority for matlab. That MIGHT help. Sadly I have no found anything bar CPU priorities in windows and I suspect that disk IO priorities could help here.
  • ALl in all I would either be aware of how much memory I used and not exceed it. Our buy more memory if I often exceeded it by an affordable amount. Or go safe and run it in its own VM. (Virtual box and vmware player are free, though you would need a legal OS). – Hennes – 2015-08-02T09:08:59.643

    0

    This will help will IO contention.

    1. Get an SSD which has 5x or more the IO.
    2. Add a second hard drive and move the swap file to it (The OS and swap file will never share IO this way)
    3. Both 1 & 2

    Defragging will help slightly, but not work any miracles.

    Turning off or limiting the windows swap file will cause windows to become slow and ugly.

    cybernard

    Posted 2015-07-31T11:05:06.820

    Reputation: 11 200

    1Some nice to have background: Turning off swap (or rather, paging since we have not used swap in ages) means that the usignable virtual adress space equals ream address space (aka RAM). That means no paging out of unused data, thus less free memory and fewer disk buffers. I assume the last if the main cause for the slow downs. – Hennes – 2015-08-02T09:04:59.853