- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Detached process executing BASIC program slowly ru...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2004 02:25 AM
10-29-2004 02:25 AM
We are perpetually executing a BASIC program as a detached process that wakes up every 5 minutes, and if there is work to do, performs the work (updates to RMS files and Rdb database tables) then goes back to sleep. The process slowly (over many days) eats up page file until it exceeds its quota. I have never seen this behavior in a BASIC program (at least not that I have written, and no, I did not write the program in question!), and thought BASIC to be fairly impervious to memory leaks and such. I have analyzed the code and cannot find any statements that might cause the problem. There are no dynamically allocated arrays or other constructs that dynamically allocate memory, no global variables, NO GOSUBS with missing RETURN statements, no files left open between sleep periods, etc.
Does anyone have experience with this problem, or expertise in leaking BASIC program?
Thanks,
Dan Herron
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2004 04:24 AM
10-29-2004 04:24 AM
Solutionthat is the problem; what shareable images
are activated?
Are you using callable SQL?
(I'm not attempting to implicate SQL, but offering that as a possibility).
--Rob (who enjoys using
BASIC to do quick-and dirty stuff in kernel
mode)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2004 04:27 AM
10-29-2004 04:27 AM
Re: Detached process executing BASIC program slowly runs out of page file quota
Maybe it should... just keep them open.
>>> The process slowly (over many days) eats up page file until it exceeds its quota.
Maybe to most cost-effective solution is to have the process re-start itself once a day (Basic CHAIN, or LIB$DO_COMMAND?).
Do any of those files have global buffers?
We have seen 'address laddering' where virtual memory for the global buffers interacts with virtual memory for lib$get_vm and friends. Global buffers are mapped during SYS$CONNECT with SYS$CRMPSC + EXPREG. They are un-mapped with $DELTVA in $DISCONNECT ($CLOSE). However, that deltva is only effective if it is the last VA in use. So... you'd have to either
- close your files in LIFO order: Open 1,2,3 ... close 3,2,1 which most application do not do.
- make an extra effort to keep files with globla buffers open
- disable gloabl buffers for this process through USEROPEN setting FAC$W_GBC=0 between $OPEN and $CONNECT.
Now thise is 'just VA' and shoudl not influence 'pagefilequota' directly, but I can readily imagine further interactions.
How much memory are you loosing? A little bit per-cycle, or like 128 KB every so many cycles? I suspect the latter, as LIB$GET_VM will eventually need to do an EXPREG. You may get a better picture by adding a call to LIB$SHOW_VM when going to sleep.
You may be able to create a workaround by doing an explcit GET_VM for 'a lot', say 10MB at program start and releqasing immediately. This will prevent 'laddering' of Virtual Memory use: VM - RMS-buffer - RMS-structures - more VM - more RMS structures - more VM - more RMS buffers ....
Good luck!
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2004 04:37 AM
10-29-2004 04:37 AM
Re: Detached process executing BASIC program slowly runs out of page file quota
The RMS files do not have global buffers associated with them.
The BASIC code does not have any calls to LIB$GET_VM. All the memory allocation statements are created by the BASIC compiler in response to standard BASIC instructions within the source code.
There are no calls to any shared application images.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2004 05:51 AM
10-29-2004 05:51 AM
Re: Detached process executing BASIC program slowly runs out of page file quota
Understood, but a simple A$="test" will do a an implicit get_vm under the cover.
I you can 'snap' the process while active, then you may want to use ANA/SYS... SET PROC "your server"... SHOW PROC/RMS=(RAB,FAB,BDBSUM,GBH,NOIFB=XX) and monitor the addresses as they move (or not). The xx woudl be the 'IFI' from a FAb for a significant file for the server.
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2004 10:42 PM
10-31-2004 10:42 PM
Re: Detached process executing BASIC program slowly runs out of page file quota
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2004 01:29 AM
11-01-2004 01:29 AM
Re: Detached process executing BASIC program slowly runs out of page file quota
I'm with Hein: in BASIC a simple A="B" allocate dynamic memory.
However this implies a trouble in garbage collector of BASIC RTL.
I don't know the VMS version but in MS-BASIC there is a FREE("") statement to brute force garbage collection; you could execute it before sleep process.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2004 02:32 AM
11-01-2004 02:32 AM
Re: Detached process executing BASIC program slowly runs out of page file quota
Which VMS version ? VAX, Alpha or IA64 ? Which version of the BASRTL ? Which optimization level did you use when compiling ? Did you try using both the debugger and the Heap Analyzer, running your program interactively to locate when the leak occurs ? Did you DBG> DUMP the leak ?
Is this leak observed following an upgrade of either VMS or the compiler ? Can you post a $ PRODUCT SHOW HISTORY ?
Hoping these questions can help you in identifying the leak.
Philippe