Hi Werner

Thanks for your input, I will look into a limit on GDI objects being the problem.

Kind regards

John

Sent from my iPad

On 15 Mar 2014, at 10:23, Werner Smekal <werner.smekal@miscdebris.net> wrote:

Hi John,

using wxWidgets on Windows I sometimes encountered a limit of GDI Objects. Everything you do in the GUI needs a GDI Object - but this is limited to 10000 per process. This could explain your behaviour (works a while and then crashes or freezes). E.g. see here:

http://stackoverflow.com/questions/9723470/whats-the-upper-limit-on-gdi-objects-for-one-process-in-windows-7

I don't know the wingcc driver to well, but maybe it uses always new GDI objects if you call plenv and if you do that hundred times....

HTH,
Werner

<compose-unknown-contact.jpg>
14 March 2014 22:46
Hi Alan

Thanks for your comprehensive reply, did you see my second posting regarding the freeze occurring when window events occur? I'm tending to think it is a window event issue in the wingcc code. I did monitor window resources during my program run and freeze, memory usage didn't appear to be a problem.

I will digest your email and do some further diagnosis as you suggest.

I'm using Windows only because I have to at the moment. I intend to migrate to a Unix platform, which I am more familiar with, as soon as possible.

Kind regards

John

Sent from my iPhone


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general
<compose-unknown-contact.jpg>
14 March 2014 22:33

Hi John:

My guess is you are encountering some sort of memory management issue
(heap corruption) or memory leak in the wingcc code or in the PLplot
core library that is triggered by all your iterations.

My bet is on a memory management issue for the combination of
wingcc and the general PLplot -np option that you are using. My
impression is that combination does not work as well as it should. For
example, although results for the wingcc device normally display well
for me on the Wine platform, they only show "transparent" results
(just the frame for the window with everything else leaking through
from the display below) if the -np PLplot option is used. Of course,
this strange behaviour might just be the result of a Wine bug, but the
other alternative is some memory management issue with how -np is
implemented for the wingcc device driver that is creating a wide
variety of peculiar results on various platforms.

To distinguish whether the problem is in wingcc + the -np option or in
the PLplot core, what happens if you try the equivalent for the svg
device? (The -np option is ignored in that case since svg is a
file-oriented device. However, use the command line options

-fam -fflen 3

so that each of your plot pages [generated by plenv] will be written
to a separate file rather than just the first page written to one file
with the rest of the pages dropped). I also suggest you keep the
number of iterations small until you get an idea of the disk space
consumed by all the different svg page files you are going to generate
by a large number of iterations.

If you do have any trouble with the svg case could you simplify the
example as much as possible while still demonstrating the issue, and
then send me that simplified code so I can try it for myself? I would
be happy to run it here on Linux under valgrind to check for any
memory management or memory leak issues. Unfortunately, I cannot do
such a check for wingcc since wingcc is Windows only and valgrind is
Unix only.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general
<compose-unknown-contact.jpg>
14 March 2014 21:21
Hi

I have the following pseudo code which work well until it freezes...

plsdev("wingcc");
plspage(0, 0, 1600, 800, 0, 0);
plspause(0);
plinit();

for (...) {
plenv(); // set new x & y max and min parameters
plline(); // data to plot
}

plend();

Like I say, it works well until it freezes after a few hundred iterations of displaying data. I would appreciate any help in pointers where to look for problems, my code or within the "wingcc" driver. When the code freezes, Windows reports the plotting window as not responding.

Kind regards

John



From: Alan W. Irwin <irwin@beluga.phys.uvic.ca>
To: John Duffy <jb_duffy@btinternet.com>
Cc: "plplot-general@lists.sourceforge.net" <plplot-general@lists.sourceforge.net>
Sent: Sunday, 2 February 2014, 18:47
Subject: Re: [Plplot-general] Updating Interactive Display with New Data

On 2014-02-02 13:54-0000 John Duffy wrote:

> Hi
>
> I would like to use PLplot to display experimental data as it is generated, i.e have the plot updated "live". I have tried a loop construct as per the pseudo code below, but I can only get the plot to update by clicking on mouse button 3. Any help/suggestions would be greatly appreciated.
>
>
> int main()
> {
>     double x[n];
>     double y[n];
>
>     plsdev("xwin");
>
>
>     plinit();
>
>
>     for (;;) { // Wait for new data and update x & y arrays
>
>         plenv(...); // Set new x & y ranges
>         plline(...); // Plot new data
>
>     }
>
>     plend();
>
>     exit(0);
>
> }

I suggest you try the -np (no pause between pages) command-line option or
the equivalent plspause(0) call.  We use the -np option a lot in
our interactive test targets for PLplot so that we don't have to
be clicking a lot when running those tests.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general