Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: end of infinite recursion in pl/sql?
> During development of a pl/sql package I bumped into an interesting
> phenomena that should be familiar to those who had their lession in
> other high level programming language. I coded a a package like this:
[snipped code of a package that was not compilable but called itself recursively]
> the associated server process entered an infinite loop. TOP shows its
> is using close to 100% CPU time (it was on a multiprocessor machine).
> Now the question is, if one does not get the DBA or Sys Admin to kill
> the process, would it ever finish or respectively abort? Or would it
> run forever until shutdown?
>
> In other programming language, afik each recursive call uses up a
> chunk of memory on the stack and when the stack crashed into some
> boundaries, the process will abend. However does it work on Oracle?
> Where does Oracle create the stack and where could one find this stack
> growing? Would it run into some boundary eventually?
I ran your programm after correcting it on an Oracle 9.2 on windows and another session (where I was logged into as sysdba and queried dba_free_space, if that is important for this issue?) reported
ORA-00604: error occurred at recursive SQL level 1 ORA-04030: out of process memory when trying to allocate 1952 bytes (top call heap,frame segment)
And all sorts of other strange things happened: windows showed message boxes telling me that it was short of virtual memory and that it would assist me in finding unused files to be deleted, evertyhing got real slow (of course, swapping memory).
So, my assumption is that Oracle does not use the Processor Stack, but manages an internal one. Don't even know if that is required by ADA from which PL/SQL derives.
Rene Nyffenegger
-- no sig todayReceived on Tue Jan 21 2003 - 16:11:49 CST
![]() |
![]() |