RE: smon 4030 - quick ideas?

  • From: "Tanel Poder" <tanel.poder.003@xxxxxxx>
  • To: <kevinc@xxxxxxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Sat, 3 Jun 2006 14:25:23 +0800

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:
//www.freelists.org/archives/oracle-l/05-2005/msg00445.html

Tanel.

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
On Behalf Of Kevin Closson
Sent: 03 June 2006 13:11
To: oracle-l@xxxxxxxxxxxxx
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.
--
//www.freelists.org/webpage/oracle-l


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


Other related posts: