Descriptors used (AREV Specific)
At 21 DEC 2007 04:57:24PM Ralph Johler wrote:
The Arev WHO window displays the number of descriptors used. I have a program that 'screen scrapes' this value out of the window, but it is not much more that a big fat hack.
Is there some method of obtaining the WHO descriptors used value as a sub or function in R/basic?
Merry Christmas all!
At 21 DEC 2007 06:28PM Victor Engel wrote:
I think there's a program in one of the older utilities diskettes that does that.
At 22 DEC 2007 01:58PM Warren Auyong wrote:
The built-in descriper function returns the info you need. Passed parameter dummy1 must be set in the calling program for the following to work. If you want to run this as a stand-alone program for testing at least two variables need to be assigned prior to the descripter line. E.G. replace function du(dummy1) with the line dummy1=';dummy2=' and delete the return statement. Difference in the descriptor count shown by this program, who and the "#" in the debugger is due to the variables used by the other processes.
function du(dummy1) d.used=descripter(dummy1)3,2 d.used=256 * seq(d.used2,1) + seq(d.used1,1) d.used=int(d.used/10) call msg('D used: ':d.used,'','','') perform "who" debug return d.used
At 27 DEC 2007 02:18AM Eric wrote:
It's always the *unused* descripter count that is more useful.
At 31 DEC 2007 03:24PM Ralph Johler wrote:
Warren - thanks! Works great.
At 31 DEC 2007 05:29PM Ralph Johler wrote:
Eric
Sorry for the blah-blah-blah but I'm wondering about your posting ]
We have a "batch job" program that loops endlessly in an Arev Session and then the date/time arrives for a scheduled arev process to be run, the 'batch job' program launches it.
Our troubles are that we suspect one or more of the programs the 'batch job' program launches are "leaking" descriptors (or other memory) and not returning that memory when they finish for garbage collect. Or it's an NTVDM memory leak.
Since we run about 75 programs with way a day, it's a bit hard to identify the offending program(s).
The end result is that about once a day or every three days some program will abend and arev disappears probably due to some kind of memory issues. The ntvdm then closes on exit. Since it is different programs that die (and worked the day before and then work the day after) I suspect the memory issue(s).
So I thought I'd log memory statistics before/after each launched program. One item I'm looking at is the Change in Descriptors before/after.
Why is *unused* more useful to measure unreleased descriptors? How would I use 'descriptor' to obtain the unused count?
At 31 DEC 2007 11:51PM Warren Auyong wrote:
Strategic use of GARBAGECOLLECT and FLUSH helps in these situations.
Perform statements and use of the braces/calculate functions are usually the main culprits.
Use of these statements can be expensive timewise so they should not be used within something like a readnext loop.
At 02 JAN 2008 12:10PM Victor Engel wrote:
"at least two variables need to be assigned"
Why is this?
At 02 JAN 2008 01:41PM Warren Auyong wrote:
I'm not clear on the actual technical details but ideally you want the pointer to the variable. Without the system compiler you normally do not have access to pointers. Setting at least two variables probably defines the memory boundaries that the function needs to determine the size of the descriptor table.