Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

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

RE: smon 4030 - quick ideas?

From: Tanel Poder <tanel.poder.003_at_mail.ee>
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: http://www.freelists.org/archives/oracle-l/05-2005/msg00445.html

Tanel.

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

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Kevin Closson
Sent: 03 June 2006 13:11
To: oracle-l_at_freelists.org
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.
--

http://www.freelists.org/webpage/oracle-l

--

http://www.freelists.org/webpage/oracle-l Received on Sat Jun 03 2006 - 01:25:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US