Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8541441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:49:57+00:00 2026-06-11T11:49:57+00:00

I was wondering why Matlab doesn’t use swap, but instead throws the error Out

  • 0

I was wondering why Matlab doesn’t use swap, but instead throws the error “Out of memory”?

Shouldn’t Matlab just slow down instead of throwing an “Out of memory”?

Is this Java related?

added:

I know “out of memory” means it’s out of contiguous memory. Doesn’t swap have contiguous memory, or? I’m confused…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:49:59+00:00Added an answer on June 11, 2026 at 11:49 am

    It is not about MATLAB. What happens when you try allocate more memory than exists in your hardware is an OS specific behavior.

    On Linux, by default the OS will ‘optimistically’ allocate almost anything you want, i.e. swap space is also counted as allocatable memory. You will get what you want – no OOM error, but slow computations with swap-allocated data. This ‘feature’ is called overcommit. You can change this behavior by modifying the overcommit settings in Linux (have a look e.g. here for a brief summary).

    Overcommit is probably not the best idea to use this for solving larger problems in MATLAB, since the entire OS starts to work really slow. It can definitely not be compared to optimized ‘out-of-core’ implementations that consciously use the hard disk in computations.

    This is how it is on Linux. I do not know how to change the memory allocation behavior on Windows, but I doubt you really want to do that. You need more RAM.

    And you do confuse things – swap has nothing to do with contiguous memory. Memory allocated by the OS is ‘virtual memory’, which is contiguous regardless of whether the underlying physical memory can be mapped to contiguous pages.

    Edit For transparent ‘out-of-core’ operations on large matriices using disk space as extra memory you might want to have look at VVAR fileexchange project. This class pretends to be a usual MATLAB class, but it operates on an underlying HDD file. Note that the usual array size limitations of MATLAB still apply.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know Octave/MATLAB can play arrays as sound, but I was wondering if Octave
I am doing string processing in Matlab and I usually use cell arrays to
just wondering if there is a simple way in java to display the contents
I'm wondering why matlab does not display access types of class methods and attributes
I am wondering whether I can do the following efficiently in Matlab. Writing a
pymat doesnt seem to work with current versions of matlab, so I was wondering
I'm wondering if there any c/c++ libraries out there that imitate the functuonality that
I was wondering if there is an easy way in MATLAB to do the
I am wondering if there is any keyword in R for jumping out of
Reading this question on importing ColorData from matlab, I was wondering if there is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.