help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error: memory exhausted or requested size too large for range of Oct


From: Jordi Gutiérrez Hermoso
Subject: Re: error: memory exhausted or requested size too large for range of Octave's index type -- trying to return to prompt
Date: Fri, 2 Nov 2012 14:57:20 -0400

On 2 November 2012 14:25, japindado <address@hidden> wrote:

> This topic has been discussed before, but I have read all of the
> threads and none of them have the answer to my issue, so I am
> posting here hoping someone can help... Basically, Octave will not
> allow the total memory consumed by all variables to exceed ~1.5GB...
> My machine runs Windows7 Enterprise N 64-bit on an Intel i7 with 9GB
> RAM. Any help would be greatly appreciated.

Can you compile and run the following C++ program and report back?

    #include <iostream>

    int main()
    {
      using namespace std;

      size_t n = 2;
      for(size_t i = 0; i < 32; i++)
      {
        try{
          double *x = new double[n];
          delete[] x;
          cout << "iter: " << i
               << " memory: " << sizeof(double)*n
               << " length: " << n
               << endl;
          n *= 2;
        }
        catch (std::bad_alloc) {
          cout << "error: memory exhausted or requested size too large
for range "
               << "of Octave's" << endl
               << "index type -- trying to return to prompt" << endl;
          break;
        }
      }
    }

Thanks,
- Jordi G. H.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]