We help IT Professionals succeed at work.
Get Started

ORA-04030 out of process memory: related to repeatedly initializing record type?

murphji asked
Last Modified: 2012-08-21
Am developing a Pl/SQL program and the program is quick and successful when run for a small number (1000) of rows but fails after a long run (30 minutes) if scaled up to 10,000 rows. It fails with an out of memory ORA-04030 error.

What it does:
Program processes records in a loop, calling several functions along the way. Many of these functions populate a record type like the following example:

rMyRec MyRecType; -- a type we defined

cursor c is select * from blah;

For r in c loop
  -- do something with current record "r" and data in rMyRec
end loop;

MyFunction does this

  rMyRec := MyRecType(null, null, null, null, null, null);
then reads a record and puts data into rMyRec

Question is: does initializing this over and over without ever releasing it cause it to use up memory, so that running with larger number of records results in memory error? That is, does it use new memory every time I do:
     rMyRec := MyRecType(null, null, null, null, null, null);

If this is the problem should I be destroying the initialized record every time, or initialize it one time in the calling routine, or something else?


Watch Question
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE