I'll take a wild guess. Maybe IBM can confirm this.

When you run a BASIC program the runtime allocates memory space
for BASIC variables.  When you use these variables for strings,
integers, or dynamic arrays the BASIC runtime manages that space.

When you EXECUTE, another process is temporarily created.  When
you CAPTURE, the StdOut from that process needs to go
"somewhere".  They can't push it back directly into BASIC space
of the parent process so they allocate new memory space (on the
"heap") and load the data.  When they return control back to your
current process they either return a pointer back to BASIC that
indicates where the new memory space is, or they will pass back a
string which BASIC then stores in the Capturing var.

Now, it seems to me that "someone" isn't letting go of the memory
that was created in the secondary process.
- If a 'ps' shows new processes are still there after Execute,
then it's obvious that because the processes aren't gone they
haven't released their resources.
- If the processes are gone then it's possible that a handle to
the new memory space was passed back to BASIC, but BASIC didn't
release the resource after it was used to populate your Capturing
variable.
- It could also be possible that it's the responsibility of the
secondary process to release its own resources, but due to some
release-specific bug in your HPUX11.23/UV10.2.6 that isn't
happening.

I would ask IBM to find out which process is supposed to be
releasing memory.  Specifically, someone does a malloc() and
someone is supposed to be doing a free().  It's pretty easy to
miss one free() instruction, and that's what causes memory leaks
like what you're seeing.

HTH
Tony Gravagno
Nebula Research and Development
TG@ remove.pleaseNebula-RnD.com

Currently serving as technical editor for "C#3.0 Unleashed" for
SAMS Publishing, and at the very moment I read this note I
happened to also be reading about memory allocation and garbage
collection - which generally isn't a problem in .NET.   ;)

(Link to book at Amazon.com, book won't be available for a couple
months.)
http://tinyurl.com/2mvn2v 

> From: Stevenson, Charles 
>    CDS.BP M
>    01 LOOP
>    02   EXECUTE '* anything' CAPTURING X
>    03 REPEAT
> 
>    >RUN CDS.BP M
>    Memory fault(coredump)
>    3046$ls -l core
>    -rw-------   1 cds33896   tech       279499648 Mar 17 17:11
core
> > This is on HP Itanium, HPUX11.23, UV10.2.6
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to