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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How does Oracle manage the possiblity of memory leak?

Re: How does Oracle manage the possiblity of memory leak?

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Thu, 09 Jan 2003 18:03:53 GMT
Message-ID: <dQiT9.1173$0m4.74378441@newssvr21.news.prodigy.com>


C Chang wrote:
> if a trigger has to call another function to process data, how oracle
> manages the multiple copies of the function when the trigger has been
> called multiple times? Is there an automatic garbage collector within
> PL/SQL process? my system is 8.1.6 on NT 4
>
> C Chang

The Oracle application is written mostly in C (which is why it "runs" on any platform with a C compiler) ... and memory leaks are a problem in many C programs ... but the Oracle rdbms app is older than dirt and has closed up pretty much every memory leak.

As for your question about multiple copies of stored procedures - as you know, code is read-only and only *one* copy needs to exist in memory. To make the call, I just place some stuff on my local stack and jump right into the beginning of that single segment of "shared" code. At the end of the code is a return that will clean the stack and return to me. As long as I have local stack space available, everything will work out ok. Oracle doesn't have to write its own garbage collection routines.

Of course, bad things might happen if Oracle were to generate buggy executable code (but if your stored procedure compiles, then you can rest assured that the generated machine language code won't do anything strange). Just as in any other app that runs in an o/s, if the o/s hiccups while the app is running, the stack might not be cleaned up ... but if the o/s does something like that, you usually have to reboot anyhow. Received on Thu Jan 09 2003 - 12:03:53 CST

Original text of this message

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