xlim gives memory exhausted error when used after plotting (v3.4.3 MinGW Windows)

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

xlim gives memory exhausted error when used after plotting (v3.4.3 MinGW Windows)

Bernhard Weller
I encounter a problem, which I didn't using 3.4.2 MinGW.

It's a bit strange as I was not able to recreate the problem using a simple example, but only with my measured values.

The m-file as well as the data is available from my website (don't know how big a file attachment is allowed to be):
http://arsenal-of-wisdom.org/downloads/xlimerror.zip (~40 kB)

My code is pretty straightforward (after narrowing it down):
clear; close all;
load xlimerror.mat
figure(1); clf;
hold on
semilogx(EstF, 20*log10(EstMag), 'b-')
xlim([minF maxF])

The error is related to the xlim([minF maxF]) line and says:
error: memory exhausted or requested size too large for range of Octave's index type -- trying to return to prompt

So something inside xlim goes wrong - my data is only a tiny 2623x1 for x and y. And a total of 42kB used memory.

I noticed that if I place the xlim line before the plot command I don't get an error message.
Is it required to put xlim before the plot commands?
Reply | Threaded
Open this post in threaded view
|

Re: xlim gives memory exhausted error when used after plotting (v3.4.3 MinGW Windows)

bpabbott
Administrator

On Feb 9, 2012, at 7:43 AM, Bernhard Weller wrote:

> I encounter a problem, which I didn't using 3.4.2 MinGW.
>
> It's a bit strange as I was not able to recreate the problem using a simple
> example, but only with my measured values.
>
> The m-file as well as the data is available from my website (don't know how
> big a file attachment is allowed to be):
> http://arsenal-of-wisdom.org/downloads/xlimerror.zip (~40 kB)
>
> My code is pretty straightforward (after narrowing it down):
> clear; close all;
> load xlimerror.mat
> figure(1); clf;
> hold on
> semilogx(EstF, 20*log10(EstMag), 'b-')
> xlim([minF maxF])
>
> The error is related to the xlim([minF maxF]) line and says:
> error: memory exhausted or requested size too large for range of Octave's
> index type -- trying to return to prompt
>
> So something inside xlim goes wrong - my data is only a tiny 2623x1 for x
> and y. And a total of 42kB used memory.
>
> I noticed that if I place the xlim line before the plot command I don't get
> an error message.
> Is it required to put xlim before the plot commands?

Your example works for me on MacOS, so it may be tricky to determine what is wrong.

You array size only consumes 20984 bytes, so I doubt you've exhausted your memory.  But please run the example below to be sure.

        clear all
        close all
        figure (1)
        clf
        hold on
        semilogx (rand (10000,1))
        xlim ([[1040.3, 1090.4]])

Does the problem persist if you quit and restart Octave ?

What if you reboot Windows ?

Are "clf" and "hold on" necessary to produce the problem ?

If you don't include the xlim() statement in  your script does it run ok? Does it then fail if you type it at the command line ?

I noticed the xrange is 1040.3 to 1090.4.  Maybe there is something about using a log scale with such a narrow range of data?

What does the following do ?

        clear
        close all
        figure (1)
        clf
        hold on
        semilogx ([1040.3, 1090.4], 20*log10([0.029369, 23.101]))
        xlim ([[1040.3, 1090.4]])

If that also fails, then try ...

        clear
        close all
        figure (1)
        clf
        hold on
        set (gca, "xscale", "log")
        xlim ([[1040.3, 1090.4]])

If neither have a problem then, try

        clear
        close all
        figure (1)
        clf
        hold on
        plot (EstF, 20*log10(EstMag))
        xlim ([[1040.3, 1090.4]])

Ben
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: xlim gives memory exhausted error when used after plotting (v3.4.3 MinGW Windows)

Jordi Gutiérrez Hermoso-2
In reply to this post by Bernhard Weller
On 9 February 2012 07:43, Bernhard Weller <[hidden email]> wrote:

> I encounter a problem, which I didn't using 3.4.2 MinGW.
>
> It's a bit strange as I was not able to recreate the problem using a simple
> example, but only with my measured values.
>
> The m-file as well as the data is available from my website (don't know how
> big a file attachment is allowed to be):
> http://arsenal-of-wisdom.org/downloads/xlimerror.zip (~40 kB)
>
> My code is pretty straightforward (after narrowing it down):
> clear; close all;
> load xlimerror.mat
> figure(1); clf;
> hold on
> semilogx(EstF, 20*log10(EstMag), 'b-')
> xlim([minF maxF])
>
> The error is related to the xlim([minF maxF]) line and says:
> error: memory exhausted or requested size too large for range of Octave's
> index type -- trying to return to prompt
>
> So something inside xlim goes wrong - my data is only a tiny 2623x1 for x
> and y. And a total of 42kB used memory.
>
> I noticed that if I place the xlim line before the plot command I don't get
> an error message.
> Is it required to put xlim before the plot commands?

This is probably related to a number of log plotting bugs we have. I
think they've been fixed in 3.6.1. We'll probably be releasing 3.6.1.
soon. The release-candidate is currently making the rounds.

Indeed, I just confirmed that your problem exists in a development
build I have prior to these patches but it doesn't happen after them.

- Jordi G. H.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: xlim gives memory exhausted error when used after plotting (v3.4.3 MinGW Windows)

nitnit
In reply to this post by Bernhard Weller
The problem is probably due to some bug in the xlog scalling logic for your specific xlim.

Your specific xlim (about 5% relative range) represents an almost linear scale also in a logarithmic scale so at least for that xlim you can simply use plot instead of semilogx and the plot will look almost identical to as it was drawn with semillogx (I have tried that with matlab).
Reply | Threaded
Open this post in threaded view
|

Re: xlim gives memory exhausted error when used after plotting (v3.4.3 MinGW Windows)

Bernhard Weller
In reply to this post by bpabbott
Hey Ben,

I tried some things you suggested, first clf, and hold on are not required to reproduce the problem (sorry about that, forgot to take that out).

        clear all
        close all
        figure (1)
        semilogx (rand (10000,1))
        xlim ([[1040.3, 1090.4]])

This crashed octave because of clear all (segmentation violation, sounds like another issue), if I use just clear, I get the error described.

        clear
        close all
        figure (1)
        clf
        hold on
        semilogx ([1040.3, 1090.4], 20*log10([0.029369, 23.101]))
        xlim ([[1040.3, 1090.4]])

Error happens again.

        clear
        close all
        figure (1)
        set (gca, "xscale", "log")
        xlim ([[1040.3, 1090.4]])

Also gives the problem - without any data involved at all.

        clear
        close all
        figure (1)
        plot (EstF, 20*log10(EstMag))
        xlim ([[1040.3, 1090.4]])

This works - but well isn't a logarithmic scale (so probably that's the issue).

It also doesn't matter if I type it directly or if it runs from a script. I can also run the script without xlim just fine and then type xlim directly and the error appears then as well.

Reply | Threaded
Open this post in threaded view
|

Re: xlim gives memory exhausted error when used after plotting (v3.4.3 MinGW Windows)

Bernhard Weller
In reply to this post by Jordi Gutiérrez Hermoso-2
Jordi Gutiérrez Hermoso-2 wrote
This is probably related to a number of log plotting bugs we have. I
think they've been fixed in 3.6.1. We'll probably be releasing 3.6.1.
soon. The release-candidate is currently making the rounds.

Indeed, I just confirmed that your problem exists in a development
build I have prior to these patches but it doesn't happen after them.

- Jordi G. H.
Okay, so I'll upgrade to 3.6.1 as soon as it's out. It's just a bit strange that this error wasn't present in 3.4.2 and now is there in 3.4.3.
Reply | Threaded
Open this post in threaded view
|

Re: xlim gives memory exhausted error when used after plotting (v3.4.3 MinGW Windows)

Doug Stewart-4
In reply to this post by Bernhard Weller


On Thu, Feb 9, 2012 at 9:16 AM, Bernhard Weller <[hidden email]> wrote:
Hey Ben,

I tried some things you suggested, first clf, and hold on are not required
to reproduce the problem (sorry about that, forgot to take that out).

       clear all
       close all
       figure (1)
       semilogx (rand (10000,1))
       xlim ([[1040.3, 1090.4]])

This crashed octave because of clear all (segmentation violation, sounds
like another issue), if I use just clear, I get the error described.

       clear
       close all
       figure (1)
       clf
       hold on
       semilogx ([1040.3, 1090.4], 20*log10([0.029369, 23.101]))
       xlim ([[1040.3, 1090.4]])

Error happens again.

       clear
       close all
       figure (1)
       set (gca, "xscale", "log")
       xlim ([[1040.3, 1090.4]])

Also gives the problem - without any data involved at all.

       clear
       close all
       figure (1)
       plot (EstF, 20*log10(EstMag))
       xlim ([[1040.3, 1090.4]])

This works - but well isn't a logarithmic scale (so probably that's the
issue).

It also doesn't matter if I type it directly or if it runs from a script. I
can also run the script without xlim just fine and then type xlim directly
and the error appears then as well.



--
View this message in context: http://octave.1599824.n4.nabble.com/xlim-gives-memory-exhausted-error-when-used-after-plotting-v3-4-3-MinGW-Windows-tp4372683p4372981.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave

It crashes because your limits are less than 1 log cycle, we think it is fixed now in the soon to come release.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: xlim gives memory exhausted error when used after plotting (v3.4.3 MinGW Windows)

tmacchant
In reply to this post by Bernhard Weller
Hello

I have build 3.6.1-rc0 on MinGW and test the script

GNU Octave, version 3.6.1-rc0
Copyright (C) 2012 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.

Octave was configured for "i686-pc-mingw32".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/help-wanted.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.

For information about changes from previous versions, type `news'.

octave.exe:1> cd E:\usr\Tatsu\test\octave
octave.exe:2> clear; close all;
octave.exe:3> load xlimerror.mat
octave.exe:4> figure(1); clf;
octave.exe:5> hold on
octave.exe:6> semilogx(EstF, 20*log10(EstMag), 'b-')
octave.exe:7> xlim([minF maxF])
octave.exe:8>

As was seen the above

error: memory exhausted or requested size too large for range of Octave's index type -- trying to return to prompt

did not occur on 3.6.1-rc0

So please wait while.

Regards

Tatsuro

--- On Thu, 2012/2/9, Bernhard Weller wrote:

>
> Jordi Gutiérrez Hermoso-2 wrote
> >
> >
> > This is probably related to a number of log plotting bugs we have. I
> > think they've been fixed in 3.6.1. We'll probably be releasing 3.6.1.
> > soon. The release-candidate is currently making the rounds.
> >
> > Indeed, I just confirmed that your problem exists in a development
> > build I have prior to these patches but it doesn't happen after them.
> >
> > - Jordi G. H.
> >
>
> Okay, so I'll upgrade to 3.6.1 as soon as it's out. It's just a bit strange
> that this error wasn't present in 3.4.2 and now is there in 3.4.3.
>
>
> --
> View this message in context: http://octave.1599824.n4.nabble.com/xlim-gives-memory-exhausted-error-when-used-after-plotting-v3-4-3-MinGW-Windows-tp4372683p4373009.html
> Sent from the Octave - General mailing list archive at Nabble.com.
> _______________________________________________
> Help-octave mailing list
> [hidden email]
> https://mailman.cae.wisc.edu/listinfo/help-octave
>
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave