PL/I Memory Leak in Windows XP 
Author Message
 PL/I Memory Leak in Windows XP

I just purchased Personal PL/I which was last update in 1998 and was
intended for Win NT. What the hell, I thought I'd give it a try on my
Windows XP Pro workstation. It compiles and executes, but I am evolving a
neural network and need the program to run unattended for long periods of
time. Unfortunately, the program I wrote and compiled with Personal PL/I
continues over time to demand more and more virtual memory. After about 15
minutes of execution, my rather beefy system says I am low on virtual
memory. Windows XP automatically increases virtual memory to compensate, but
the program continues to demand more. Now, the program will use up about 1GB
of virtual memory, almost all of which is on disk, and the program requires
so much swapping in and out that I could almost perform the calculations by
hand as quickly.

As a mainframe PL/I programmer for 20 years, this prospect does not seem
compelling. I can do it, but PL/I I already know and the language has all
the features I need.

I have a DEFAULT RANGE(*) STATIC statement, use no AUTOMATIC variables,
changed all my BASED link-lists to static arrays, and am not using any
CONTROLLED storage. I had several recursive routines, but they only went 8
deep, so I simply duplicated them each 8 times and removed the RECURSIVE
option. I now have a very basic program that just does some very intensive
FLOAT BINARY (21) operations.

Does anyone have any ideas??? Unless I find the cause of the problem and/or
a way around it, I am going to have to learn C++!!!!  I know fortran, but
have no compiler for it. Is there a Fortran compiler that implements PL/I
like POINTERs (and can allocate storage for dynamically created
linked-lists) and has the pre-processor macro facility like PL/I does?

--
Jay McInvale



Wed, 16 Mar 2005 10:57:27 GMT  
 PL/I Memory Leak in Windows XP
Hi

Would it be inappropriate to post the source here (if it inst too large) ?

Despite your changes, there may still be a bug, subtle perhaps but enough to cause this.

With the right tools on NT you can examine a process and see how its stack and heap are growing, it would help to know
which it is.

Is there any possibility that you pass differing numbers/types of args to an external PL/I routine ?

This couild be done in such a way that the compiler cant detect it.

If a routine is called with more/less args than it expects it may not crash, but will eventually exhaust the stack.

If you pushed 4 pointers but popped only 3, and did this in a loop many many times, you could gradually move the stack
pointer very far.

I dont know if Personal PL/I has the the caller pop args or the callee, so this is just a guess.

There are many PL/I experts here who may be able to provide insight.

Rgds
Hugh

Quote:

>I just purchased Personal PL/I which was last update in 1998 and was
>intended for Win NT. What the hell, I thought I'd give it a try on my
>Windows XP Pro workstation. It compiles and executes, but I am evolving a
>neural network and need the program to run unattended for long periods of
>time. Unfortunately, the program I wrote and compiled with Personal PL/I
>continues over time to demand more and more virtual memory. After about 15
>minutes of execution, my rather beefy system says I am low on virtual
>memory. Windows XP automatically increases virtual memory to compensate, but
>the program continues to demand more. Now, the program will use up about 1GB
>of virtual memory, almost all of which is on disk, and the program requires
>so much swapping in and out that I could almost perform the calculations by
>hand as quickly.

>As a mainframe PL/I programmer for 20 years, this prospect does not seem
>compelling. I can do it, but PL/I I already know and the language has all
>the features I need.

>I have a DEFAULT RANGE(*) STATIC statement, use no AUTOMATIC variables,
>changed all my BASED link-lists to static arrays, and am not using any
>CONTROLLED storage. I had several recursive routines, but they only went 8
>deep, so I simply duplicated them each 8 times and removed the RECURSIVE
>option. I now have a very basic program that just does some very intensive
>FLOAT BINARY (21) operations.

>Does anyone have any ideas??? Unless I find the cause of the problem and/or
>a way around it, I am going to have to learn C++!!!!  I know Fortran, but
>have no compiler for it. Is there a Fortran compiler that implements PL/I
>like POINTERs (and can allocate storage for dynamically created
>linked-lists) and has the pre-processor macro facility like PL/I does?



Wed, 16 Mar 2005 11:28:52 GMT  
 PL/I Memory Leak in Windows XP
in comp.lang.pl1 i read:

Quote:
>After about 15 minutes of execution, my rather beefy system says I am low
>on virtual memory. Windows XP automatically increases virtual memory to
>compensate, but the program continues to demand more. Now, the program
>will use up about 1GB of virtual memory, almost all of which is on disk,

given the price of memory perhaps you should just purchase a gig, or even
two.  (doesn't a `beefy' wintel system already have at least that much
memory?)

Quote:
>Does anyone have any ideas???

it sounds like you are simply using a lot of memory.

are you sure you aren't leaking any?  when you mentioned switching to
another language you said you'd need dynamically allocated linked lists,
which sounds like that sort of thing is present in your pl/1 program.

--
bringing you boring signatures for 17 years



Wed, 16 Mar 2005 13:18:10 GMT  
 PL/I Memory Leak in Windows XP

Quote:

> intended for Win NT. What the hell, I thought I'd give it a try on my
> Windows XP Pro workstation. It compiles and executes, but I am evolving a
> neural network and need the program to run unattended for long periods of
> time. Unfortunately, the program I wrote and compiled with Personal PL/I
> continues over time to demand more and more virtual memory. After about 15
> minutes of execution, my rather beefy system says I am low on virtual
> memory. Windows XP automatically increases virtual memory to compensate, but
> the program continues to demand more. Now, the program will use up about 1GB
> of virtual memory, almost all of which is on disk, and the program requires
> so much swapping in and out that I could almost perform the calculations by
> hand as quickly.

> As a mainframe PL/I programmer for 20 years, this prospect does not seem
> compelling. I can do it, but PL/I I already know and the language has all
> the features I need.

> I have a DEFAULT RANGE(*) STATIC statement, use no AUTOMATIC variables,
> changed all my BASED link-lists to static arrays, and am not using any
> CONTROLLED storage. I had several recursive routines, but they only went 8
> deep, so I simply duplicated them each 8 times and removed the RECURSIVE
> option. I now have a very basic program that just does some very intensive
> FLOAT BINARY (21) operations.

> Does anyone have any ideas???

Apply any updates.
Maybe Peter han help here?
Install NT?
Are you SURE that there is no recursion?  No linked lists?
Not something like ON FINISH GO TO X; ?
Not stuck in a loop with error recovery?

- Show quoted text -

Quote:
> --
> Jay McInvale




Wed, 16 Mar 2005 17:50:04 GMT  
 PL/I Memory Leak in Windows XP


FLOAT BINARY (21) operations.

Quote:

> Does anyone have any ideas??? Unless I find the cause of the problem
and/or
> a way around it, I am going to have to learn C++!!!!  I know Fortran, but
> have no compiler for it. Is there a Fortran compiler that implements PL/I
> like POINTERs (and can allocate storage for dynamically created
> linked-lists) and has the pre-processor macro facility like PL/I does?

Follow this logic:
If (Windows XP runs other Personal PL/I creations ok) Then
  edit your app. to a minimum (and I really mean minimum) program,  post the
resulting neural source with a simple test case  embedded in the
declarations along with the expected output    I assume a Personal PL/I user
on  a non Windows XP system will then cooperate by testing your program, AND
I will TRY to make it run under my CVF compiler whitch does support pointers
(I am familiar with neural nets)

Else
 IBM may have a patch to fix a PL/I problem with the XP environment,  (you
might try telling XP that your app is  NOT a     XP app.   ie.  a windows NT
app.
End If

If I succeed in translating your miniumum source to Fortran, I would bet it
runs > 3X faster vs. any PL/I exe of your test program,  wanta bet?



Wed, 16 Mar 2005 18:26:03 GMT  
 PL/I Memory Leak in Windows XP
There is a known "problem" with ALLOC / FREE with certain storage allocation
patterns. If you keep allocating larger storage blocks, freeing the
previously allocated storage block after allocating the larger block, the
freed storage is not returned to the operating system. Nor is the freed
storage coalesced with other free storage, since the blocks are allocated
separately from the operating system. If you had this problem under VA PL/I,
I'd tell you to open a PMR (Iv'e already reported it, but a second PMR could
well help).

In your case, however, you claim to have no heap storage, hence this is not
your problem.

Since the PL/I stack is statically allocated (ILINK parameter), this leaves
two possibilities:
1) bug in the runtime library. Given the age of your compiler, I do not know
if there may have been such an issue that has been resolved.
2) bug in XP.

Now to recommendations:
1) Try using VA PL/I V2.1.9. As an experienced mainframe programmer writing
"real code", you should try to use a workstation compiler that provides the
necessary prerequsities. Personal PL/I is not for you. AFAIK, the version
you have also does not claim to work on XP (VA PL/I 2.1.9 does).

2) Install XP SP1. I know of a number of storage leaks in XP (and W2K), the
MS KB lists a bunch thereof. My suspicion is that you've hit one of these.


Quote:
> I just purchased Personal PL/I which was last update in 1998 and was
> intended for Win NT. What the hell, I thought I'd give it a try on my
> Windows XP Pro workstation. It compiles and executes, but I am evolving a
> neural network and need the program to run unattended for long periods of
> time. Unfortunately, the program I wrote and compiled with Personal PL/I
> continues over time to demand more and more virtual memory. After about 15
> minutes of execution, my rather beefy system says I am low on virtual
> memory. Windows XP automatically increases virtual memory to compensate,
but
> the program continues to demand more. Now, the program will use up about
1GB
> of virtual memory, almost all of which is on disk, and the program
requires
> so much swapping in and out that I could almost perform the calculations
by
> hand as quickly.

> As a mainframe PL/I programmer for 20 years, this prospect does not seem
> compelling. I can do it, but PL/I I already know and the language has all
> the features I need.

> I have a DEFAULT RANGE(*) STATIC statement, use no AUTOMATIC variables,
> changed all my BASED link-lists to static arrays, and am not using any
> CONTROLLED storage. I had several recursive routines, but they only went 8
> deep, so I simply duplicated them each 8 times and removed the RECURSIVE
> option. I now have a very basic program that just does some very intensive
> FLOAT BINARY (21) operations.

> Does anyone have any ideas??? Unless I find the cause of the problem
and/or
> a way around it, I am going to have to learn C++!!!!  I know Fortran, but
> have no compiler for it. Is there a Fortran compiler that implements PL/I
> like POINTERs (and can allocate storage for dynamically created
> linked-lists) and has the pre-processor macro facility like PL/I does?

> --
> Jay McInvale




Fri, 18 Mar 2005 14:42:46 GMT  
 PL/I Memory Leak in Windows XP
FWIW, the poster having rudely not responded to ANY replies to his topic
message, my offer to translate an abbreviated version of his neural net PL/I
source to Fortran is withdrawn, (that was then, this is now)..


Tue, 22 Mar 2005 21:54:16 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. memory leak and leak-fixing 'patterns'

2. memory leaks with OREXX for Windows???

3. Memory leak in xmlrpclib.py on Windows?

4. memory leak in debug dll for windows

5. magic memory leak, Python or Windows problem?

6. magic memory leak, Python or Windows problem?

7. Help: Itcl Memory Leak on Windows NT

8. 32K Memory Leak in Windows app

9. Windows tcl7.5a2/tk4.1a2 memory leak?

10. Windows 2000 / XP - Memory

11. GFortran - OpenMP problem with Windows XP memory

12. python startup memory size and memory leak

 

 
Powered by phpBB® Forum Software