🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.ibm.pc.rt
4 messages
4 total messages Started by Mark Spotswood Thu, 07 Sep 1989 22:19
Memory usage on the RT.
#324
Author: Mark Spotswood
Date: Thu, 07 Sep 1989 22:19
19 lines
1314 bytes
I am working on a large application which performs its own memory management.
When I run this application, I use up all of the swap space on the machine and
AIX kills the process. I am using ulimit() to determine the maximum possible
break point. The problem is that ulimit() returns the total amount of swap
space on the machine and I am allowed to set the break point to that value.
Then I start writing to the space, and eventually all of the page space gets
used up. When this happens, AIX sends a SIGDANGER signal and kills the process.
I have a signal handler, but it is unable to react in time to prevent the
process from being killed. 

Is there any way to find out how much swap space is actually left while running,
so that I can set the break point to a more reasonable value and avoid being
killed?

I am running AIX 2.2.1 on an RT model 125.

Any help with this problem would be greatly appreciated.

-- mark
Re: Memory usage on the RT.
#329
Author: Sam Drake
Date: Sun, 10 Sep 1989 07:34
11 lines
932 bytes
In article <1247@quintus.UUCP> mark@quintus.UUCP (Mark Spotswood) writes:
>Is there any way to find out how much swap space is actually left while running,
>so that I can set the break point to a more reasonable value and avoid being
>killed?

Look at the "monitor" program, shipped with IBM's X11 product as a sample.
Among other things, it will display a real-time graph of the amount of
page space available; presumably you can use the same technique in your
application.

Sam Drake / IBM Almaden Research Center 
Re: Memory usage on the RT.
#366
Author: Johann Schweigl
Date: Thu, 14 Sep 1989 22:25
28 lines
1413 bytes
From article <1247@quintus.UUCP>, by mark@quintus.UUCP (Mark Spotswood):
> Is there any way to find out how much swap space is actually left while running,
> so that I can set the break point to a more reasonable value and avoid being
> killed?

VRM provides the information you want in the data segment of the process.

	.
	.
	.
	volatile int *freePages = (int *)0xbc;
	.
	.
	printf("number of free 2K pages in pagespace is %d\n",*freePages);
	.
	.

The volatile int declaration prevents reads to *freePages from being optimized
away by the -O option.
*freePages is modified by the VRM at unpredictable rates (unpredictable as far
as the application program is concerned).

Hope it helps. Bye,
-- 
       ------------------------------------------------------------------
       EDV Ges.m.b.H Vienna              Johann Schweigl    
       Hofmuehlgasse 3 - 5               USENET: johnny@edvvie.at
       A-1060 Vienna, Austria      Tel: (0043) (222) 59907 257 (8-19 CET)
Re: Memory usage on the RT.
#365
Author: Johann Schweigl
Date: Thu, 14 Sep 1989 22:33
13 lines
942 bytes


Sorry, iv'e misread the adress in my manuals. The correct code is

	volatile int *freePages = (int *)0xb8;

apologize for it,
-- 
       ------------------------------------------------------------------
       EDV Ges.m.b.H Vienna              Johann Schweigl    
       Hofmuehlgasse 3 - 5               USENET: johnny@edvvie.at
       A-1060 Vienna, Austria      Tel: (0043) (222) 59907 257 (8-19 CET)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads