Hi Chris:

For a bit of background information for my response to your comment
below note that my counts show that 62 per cent of current plexit
calls are associated with memory allocation errors, but I believe that
fraction will quickly exceed 90 per cent once we become rigourous
about checking for memory allocation issues. So what we do with the
memory allocation errors potentially could matter a lot in terms of
implementation/maintenance costs for our error report system.

On 2016-02-27 10:02-0500 Chris Marshall wrote:

> The problem with immediate exit on memory errors
> is that they cannot be caught.  For example, trying to
> make a perl binding to plplot would essentially crash
> perl if the plplot did an exit.

Understood.

Memory allocation fails only because there are PLplot bugs in
the size of memory requested or because the system is out of memory.

Out of memory is clearly an emergency situation where the operating
system is likely shutting down various programs arbitrarily in any
case to try to claw back some memory.  So under these emergency
conditions an immediate exit from PLplot (and the calling environment
like perl) is not a particularly bad tactic.  And such out-of-memory
emergency conditions are quite rare in any case.

On the other hand, if we do make memory allocation errors part of our
error report system, it does give at least some chance (if the OS does
not kill the perl session first) for the user to save work in an
out-of-memory emergency and if the issue is due to a PLplot size bug,
it gives them (and us) a chance to replicate the issue and debug it
further. So my conclusion is there is a modest benefit to making
memory allocation errors part of the error report system, but that
benefit has to be weighed against the implementation/maintenance
costs.

>From what Phil has said, if we can get the C setjmp/longjmp exception
handling method of error reporting to work then including memory
allocation errors as part of that report system would be fairly
trivial so it would be a no-brainer to do that.  But if we decide to
use the return code method of error reporting the costs of including
memory allocation errors in the system would be significantly higher
(significantly more independent caller paths would have to be dealt
with) so we would have to weigh those costs against the modest (in my
view) benefit discussed above.

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
__________________________

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to