Memory leak? TD5.1/SP6 & Oracle 11g

General discussion forum about all databases other than SqlBase.
JaakkoTerhonen
Finland
Posts: 93
Joined: 28 Mar 2017, 10:37
Location: Helsinki, Finland

Memory leak? TD5.1/SP6 & Oracle 11g

Post by JaakkoTerhonen » 17 Feb 2010, 19:40

Hi!

Sometimes a query in my application hogs memory, even up to 800 MB.

I have not been able to reproduce this problem in debug mode, nor in a compiled application, trying to do the same what the user does.

It happens only to some users but the procedure executed is the same for all. The platform where this happens is Windows Server 2003, TD is 5.1/SP6 and Oracle is 11g.

Is there any way I could trace this and catch the problem ?

Thank you very much for any ideas!

Best regards,
Jaakko Terhonen

Jeff Luther

Re: Memory leak? TD5.1/SP6 & Oracle 11g

Post by Jeff Luther » 19 Feb 2010, 21:33

Is there any way I could trace this and catch the problem ?
Couple of ways:
* more primitive is using SalMessageBox calls inside an If bTraceMode conditional, say, where your code can set your var. bTraceMode = T/F depending.

* A better way is to use the SAL 'trace' functions. This is the one to start with: SalStartTrace
and allows SalTrace( <string> ) value to be output to a number of destinations, depending on the constant you pass in SalStartTrace().
It happens only to some users
Then info. about their environment -- not just the O/S -- can be valuable. What else running, what's the query!, is front-end result sets turned on (I've never heard this affects memory but if your code allows a "Select * From Customer" and the user immediately wants to scroll to the last row, lots of rows may be fetched), what's the [oragtwy] "fetchrow=" in SQL.INI value for the user(s) with this failure.

Also, ask them to write down details if/when they can test before they see the problem. Also, if sophisticated enough, if they can displaying the Window Task Mgr/Processes (I'll assume availabl on Win2003) and looking at the memory usage for your appl. might gives some clues. Does memory degrade (value get higher) over time, or is it dramatic when, say, this procedure is called?
the procedure executed is the same for all.
Well, that narrows down the target. What is is, how large, plus other details may give you some more leads.

Details, details, details... that's what I'd shoot for.

Jeff Luther

Re: Memory leak? TD5.1/SP6 & Oracle 11g

Post by Jeff Luther » 20 Feb 2010, 01:55

Hi, Jaakko:

I haven't seen your source to get the details of your "procedure executed" code, but I passed a similar issue to tech/dev. internally and got back some info. from one of the tech-type people. Here's what he wrote back about that issue where Oracle was the DB and the user was calling SqlPLSQLCommand():
Recently we found that there exists memory leak issue and also data limitation issue with this API. Maybe that is causing memory issues with the customer application. Please see its documentation in TD online help.

The only workaround till now is to use SQLOra functions.
I thought I would pass this along to you. If you are calling SqlPLSQLCommand() in your code, calling the SqlOra functions instead (SqlOraPLSQLPrepare, SqlOraPLSQLExecute) might help you as well.

JaakkoTerhonen
Finland
Posts: 93
Joined: 28 Mar 2017, 10:37
Location: Helsinki, Finland

Re: Memory leak? TD5.1/SP6 & Oracle 11g

Post by JaakkoTerhonen » 21 Feb 2010, 19:56

Hello Jeff!

Thank You very much, your replies were very valuable! I didn't remember that SalTrace functionality, that is a very good gun for killing bugs :-)

This special query executes massive amount of SAL code - that's why it is practically impossible to send an example, but now I have new information when the users run into the problem and I am now getting closer.

I'm using SqlPLSQLCommand and have had many silent crashes when calling PL/SQL procedures but no memory leaks so far. BTW there is a memory leak in a certain 11g release of Oracle but not in the one we have. I don't remember the whole Oracle version but the problematic version ends with "06" and the fixed version ends with "07".

The silent crashes I have had were caused by uninitalized parameters in calls. For example if a IN OUT string parameter contained some value the app crashed, without any trace in the Windows Event log. When it was set to null everything worked fine. I believe this is caused by Oracle client ?

I will now check if there are PLSQL calls when this problematic query is executed, and maybe I will also try that SalTrace. Thanks a lot!

Best regards,
Jaakko

Jeff Luther

Re: Memory leak? TD5.1/SP6 & Oracle 11g

Post by Jeff Luther » 23 Feb 2010, 01:59

Jaakko -- Success for you, we hope! Thanks for your kind words.

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 4 guests