Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> RE: smon 4030 - quick ideas?

RE: smon 4030 - quick ideas?

From: Tanel Poder <>
Date: Sat, 3 Jun 2006 14:25:23 +0800
Message-ID: <013c01c686d6$7f77f890$6501a8c0@raibe>

In addition, recent Oracle versions haven't used malloc() for their memory allocations for a while anyway.

Oracle uses realfree heap management by default in 10g. In 9.2 only if pga_aggregate_target is set or _use_realfree_heap = true.

This means that mmap() instruction is used for memory allocation - giving the benefit to allocate and deallocate memory to/from any virtual memory range. Malloc which uses brk system call just changes the single process data segment size to larger or smaller - not allowing very flexible memory management (remember that Oracle used not to release any memory back to OS at all).

Now with realfree memory management and mmap()/munmap() system calls this has changed. UGA and CGA heaps are lifted out of PGA heap, thus they can be completely released back to OS if needed.

Usually mmap() is used to map executable files and libraries to process address space for using system memory more efficiently, so how can one just allocate blank scratch memory using mmap()? The cool trick here is that Oracle maps /dev/zero into it's address space to get some memory and as /dev/zero is an endless file, you can allocate any amount of memory you like (as long as other restrictions such address space length and usage permit).

A last year's post on the topic, which should still be mostly accurate:


-----Original Message-----

From: [] On Behalf Of Kevin Closson
Sent: 03 June 2006 13:11
Subject: RE: smon 4030 - quick ideas?  

	/* 4030 prog */
	int main (int argc, char**argv) {
	  char * buff;
	  int mbCount = 0;
	  while (1) {

[code deleted]

  Sorry. This program will not determine Oracle process heap allocation capability any more accurately than would a 3-legged pink elephant. sorry. The address space of an Oracle process has, um, a few more things in it.

  On the brighter side of things, you could Open Source this program and get the venture capital folks all excited.

-- Received on Sat Jun 03 2006 - 01:25:23 CDT

Original text of this message