Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I need to increase the Maximum possible array size

I have a 4GB Ram installed on Coure2Duo PC with a 32bit Windows 7 Operating system. I have increased the paging size up to 106110MB. But after doing all this I am not able to significantly increase the maximum array size.

Following are the specs

memory
Maximum possible array:             129 MB (1.348e+08 bytes) *
Memory available for all arrays:    732 MB (7.673e+08 bytes) **
Memory used by MATLAB:              563 MB (5.899e+08 bytes)
Physical Memory (RAM):             3549 MB (3.722e+09 bytes)

*  Limited by contiguous virtual address space available.
** Limited by virtual address space available.

Kindly help me on your earliest. I am not even able to read a file of 48+MB size in double format.

like image 457
MalikAnasAhmad Avatar asked Dec 09 '13 21:12

MalikAnasAhmad


People also ask

What is the maximum possible size of an array?

A Java program can only allocate an array up to a certain size. It generally depends on the JVM that we're using and the platform. Since the index of the array is int, the approximate index value can be 2^31 – 1. Based on this approximation, we can say that the array can theoretically hold 2,147,483,647 elements.

How do you increase the maximum size of an array in MATLAB?

Accepted Answer 1. Go to MATLAB > Preferences > Workspace and ensure the Maximum array size limit is set to 100%. Then execute 'memory' command in the Command Window and send the output. Ensure that the Maximum possible array size is larger than the memory required by the data.

What is the maximum array size in MATLAB?

Accepted Answer The maximum number of rows or columns in MATLAB is 281474976710655 which is 2^48-1 . However, the array must fit into memory.

How do you declare a maximum array size in C++?

Max size of array in C++ The C++ function std::array::max_size() is used to get the maximum number of elements that can be held by array container. Following is the declaration for std::array::max_size() function form std::array header. Returns the maximum number of elements that can be held by array container.


1 Answers

There are two things you can do to clear up memory for MATLAB. Since you're using a 32-bit version of the program, you're normally limited to 2GB of memory. Using the /3GB switch while opening the program makes an additional 1GB of RAM available to that program.

Second, you should consider using the pack() function, which rearranges variables in RAM to free up more contiguous memory space. This, more than anything, is affecting your ability to open individual arrays.

Remember: you can figure out how many items an array will hold by dividing the memory amount available by the size of the variable type. Double variables take up 8 bytes each. Your 129MB of space available should allow around 16.85 million double values in a single array.

You can view information about memory usage using the memory functions included in MATLAB.

  • memory shows the memory information
  • inmem will show you the variables and functions stored in memory
  • clear will allow you to clear the memory of specific variables or functions.
like image 57
philipthegreat Avatar answered Oct 01 '22 23:10

philipthegreat