Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: sqlplus memory leak?
Pim wrote:
>> But wouldn't that script point to a memory leak in your shell?
>> Or are you connecting locally and the server process leaks?
>> Anyway, sqlplus can't leak much from one statement and any
>> possible leak will disappear with the finishing of the process.
>> i.e. with the "/" in your script.
>>
>> Lots of Greetings!
>> Volker
>
> It appears that also a single sqlplus session does not return memory
> after it is quit.
> We have been monitoring memory usage by the following perl script:
>
> #---------------------------------------------
> #!/usr/bin/perl
> #
> $maxiter = 5000;
> $wait = 1;
> #
> open MEMLOG, '>scratch__mem';
> $iter = 0;
> while ($iter++<=$maxiter) {
> $DATE = `date +%s`;
> $VMSTAT = `vmstat`;
> @items = split (/sy id/, "$VMSTAT");
> $mstring = "$DATE "."$items[1]";
> $mstring =~ s/\n/ /g;
> print "$mstring\n";
> print MEMLOG "$mstring\n";
> sleep $wait;
> };
> close MEMLOG;
Maybe I'm blind but I haven't found the word "sqlplus" anywhere in your
perl script. And all the gnuplot graph traced was the free memory, right?
So you don't trace sqlplus' memory usage at all and it could be any other
process that lives during the time you traced memory usage. Candidates would
be your shell and several oracle processes.
Just so you understand this: In unix it is *NOT* the program's responsibility
to return the memory. it is done by the kernel after unscheduling the program.
Morale: when a program has ended the memory will be freed, with the
program having no choice in the matter (due to lack of cpu time).
Lots of Greetings!
Volker
-- While it is a known fact that programmers never make mistakes, it is still a good idea to humor the users by checking for errors at critical points in your program. -Robert D. Schneider, "Optimizing INFORMIX Applications"Received on Mon Jun 30 2003 - 05:50:47 CDT