Memory usage with Oracle VARCHAR(4000 Byte) and Long String
Memory usage with Oracle VARCHAR(4000 Byte) and Long String
Hello!
An executable (win32) which loads an VARCHAR(4000 Byte) into a Long String variable uses different memory either if it runs in TD Developer environment or in TD runtime environment.
In our customer real world application the difference we get an out of memory error.
Example:
I built a small executable which connects to a Oracle database and loads
SELECT LRT_VARCHAR4000 FROM LONGSTRINGTEST INTO :l_lsLong
a record with an empty VARCHAR(4000 Byte) field (LRT_VARCHAR4000 VARCHAR2(4000 BYTE)).
When I run the LongString executable in TD Developer environment in task manager I can see it uses about 51MB. When I run the LongString executable in TD Runtime environment in task manager I can see it uses about 139MB. That is a very high difference for such small data.
Can anybody reproduce this behavior or explain it?
Has anybody noticed similar behavior yet?
Please find attached the sample program and a script to create the database table.
Thank you!
Peter Bars
Entimo AG
An executable (win32) which loads an VARCHAR(4000 Byte) into a Long String variable uses different memory either if it runs in TD Developer environment or in TD runtime environment.
In our customer real world application the difference we get an out of memory error.
Example:
I built a small executable which connects to a Oracle database and loads
SELECT LRT_VARCHAR4000 FROM LONGSTRINGTEST INTO :l_lsLong
a record with an empty VARCHAR(4000 Byte) field (LRT_VARCHAR4000 VARCHAR2(4000 BYTE)).
When I run the LongString executable in TD Developer environment in task manager I can see it uses about 51MB. When I run the LongString executable in TD Runtime environment in task manager I can see it uses about 139MB. That is a very high difference for such small data.
Can anybody reproduce this behavior or explain it?
Has anybody noticed similar behavior yet?
Please find attached the sample program and a script to create the database table.
Thank you!
Peter Bars
Entimo AG
You do not have the required permissions to view the files attached to this post.
Re: Memory usage with Oracle VARCHAR(4000 Byte) and Long String
Hi,
just to understand it:
"TD Development Environment" is a machine, where the TD IDE is installed.
"TD Runtime Environment" is a machine, where only the TD runtime is installed.
Is that correct?
I suppose, both the TD IDE and the TD runtime are completely the same Version (Service Pack, Hot Fixes).
And also your Oracle Client files have to be the same Version!
Could you please run your sample application in both environments.
After the application loaded your 4k string, Launch Process Explorer (http://technet.microsoft.com/en-us/sysi ... s/bb896653) and explore the list of loaded modules. Are there any differences?
Max
just to understand it:
"TD Development Environment" is a machine, where the TD IDE is installed.
"TD Runtime Environment" is a machine, where only the TD runtime is installed.
Is that correct?
I suppose, both the TD IDE and the TD runtime are completely the same Version (Service Pack, Hot Fixes).
And also your Oracle Client files have to be the same Version!
Could you please run your sample application in both environments.
After the application loaded your 4k string, Launch Process Explorer (http://technet.microsoft.com/en-us/sysi ... s/bb896653) and explore the list of loaded modules. Are there any differences?
Max
Re: Memory usage with Oracle VARCHAR(4000 Byte) and Long String
Hi lrcuess,
First of all thank you for your recommendation.
Yes, you are right
"TD Development Environment" is a machine, where the TD IDE is installed and
"TD Runtime Environment" is a machine, where only the TD runtime is installed.
With the process explorer I checked the used dll’s, its versions and its memory use.
As you can see in the attached excel file “LongString.DLL.use.xlsx” :
In the pictures you can see differences in section Physical Memory. Does anybody have any idea?
Thank you!
Peter Bars
Entimo AG
First of all thank you for your recommendation.
Yes, you are right
"TD Development Environment" is a machine, where the TD IDE is installed and
"TD Runtime Environment" is a machine, where only the TD runtime is installed.
With the process explorer I checked the used dll’s, its versions and its memory use.
As you can see in the attached excel file “LongString.DLL.use.xlsx” :
- the loaded dll’s are the same,
- the versions are the same and
- even the memory usage is (almost) the same.
In the pictures you can see differences in section Physical Memory. Does anybody have any idea?
Thank you!
Peter Bars
Entimo AG
You do not have the required permissions to view the files attached to this post.
-
- Founder/Site Admin
- Posts: 3352
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
Re: Memory usage with Oracle VARCHAR(4000 Byte) and Long String
Try to run both situations on the same machine.
Copy the TDRuntime folder and your application exe/dll's into one folder and place it on the same machine the TD IDE is installed.
Run your application from that folder.
Is there a difference then?
Copy the TDRuntime folder and your application exe/dll's into one folder and place it on the same machine the TD IDE is installed.
Run your application from that folder.
Is there a difference then?
Regards,
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Re: Memory usage with Oracle VARCHAR(4000 Byte) and Long String
Hi Dave,
I have already done it before I send the post above.
On the same machine I can reproduce the results of the different machines.
Regards,
Peter Bars
I have already done it before I send the post above.
On the same machine I can reproduce the results of the different machines.
Regards,
Peter Bars
Re: Memory usage with Oracle VARCHAR(4000 Byte) and Long String
In your TD developer environment: Is the TD IDE running, when your measure the memory usage?
In your TD runtime environment: What happens if you run your sample application multiple times in parallel (keep the previous instances running when launching another)?
Max
In your TD runtime environment: What happens if you run your sample application multiple times in parallel (keep the previous instances running when launching another)?
Max
Re: Memory usage with Oracle VARCHAR(4000 Byte) and Long String
No, the IDE does not run.In your TD developer environment: Is the TD IDE running, when your measure the memory usage?
When I launch more instances and keep them running, each instance has almost the same memory usage.In your TD runtime environment: What happens if you run your sample application multiple times in parallel (keep the previous instances running when launching another)?
On the same machine:
the instances launching from the IDE have the low memory useage,
the instances launching from the runtime have the heigh memory useage.
Thank you!
Re: Memory usage with Oracle VARCHAR(4000 Byte) and Long String
Just to give it a try:
Make a backup of your TD IDE installation directory.
Copy alle files from the runtime directory into your IDE directory.
Launch the IDE and run your sample application.
High or low memory usage?
Max
Make a backup of your TD IDE installation directory.
Copy alle files from the runtime directory into your IDE directory.
Launch the IDE and run your sample application.
High or low memory usage?
Max
Re: Memory usage with Oracle VARCHAR(4000 Byte) and Long String
Low memory usage!Copy alle files from the runtime directory into your IDE directory
Peter
Re: Memory usage with Oracle VARCHAR(4000 Byte) and Long String
Hi all,
thank you for your tips.
Disconnecting the sql handel decreases the memory use to an normal level.
The real problem is, loading a 4K string consumes about 80MB memory (even the string is empty).
In our customer application we have in one SQL statement 3 of such strings. The memory use really increases about 3 times 80MB. One instance of the program uses over 300MB memory.
For that I’m still looking for a solution.
Peter
thank you for your tips.
Disconnecting the sql handel decreases the memory use to an normal level.
The real problem is, loading a 4K string consumes about 80MB memory (even the string is empty).
In our customer application we have in one SQL statement 3 of such strings. The memory use really increases about 3 times 80MB. One instance of the program uses over 300MB memory.
For that I’m still looking for a solution.
Peter
Re: Memory usage with Oracle VARCHAR(4000 Byte) and Long String
Did you ever try to use another database to compare memory consumption?
I know this doesn't solve your problem but maybe it helps to understand the problem cause.
Max
I know this doesn't solve your problem but maybe it helps to understand the problem cause.
Max
Re: Memory usage with Oracle VARCHAR(4000 Byte) and Long String
Hi all,
I got it.
Both installations uses different sql.ini files.
In the IDE uses a sql.ini with variable longbuffer=10000000.
In the Runtime uses a sql.ini with variable longbuffer=100000000.
We need this high value to store files in the database.
Does anybody know a maximum value of longbuffer?
Thank you for help and sorry for that.
Peter
I got it.
Both installations uses different sql.ini files.
In the IDE uses a sql.ini with variable longbuffer=10000000.
In the Runtime uses a sql.ini with variable longbuffer=100000000.
We need this high value to store files in the database.
Does anybody know a maximum value of longbuffer?
Thank you for help and sorry for that.
Peter
-
- Founder/Site Admin
- Posts: 3352
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
Re: Memory usage with Oracle VARCHAR(4000 Byte) and Long String
Programmatically set the longbuffer size and keep the SQL.ini setting low.
First get the current setting:
Calculate the needed buffer length and do
Set the initial value back after use.
First get the current setting:
Code: Select all
Call SqlGetParameterAll ( hSqlConnect, SQLPLBUF, nInitialBufferLength, sDummy, TRUE )
Code: Select all
Call SqlSetParameterAll ( hSqlConnect, SQLPLBUF, nBufferLength, STRING_Null, TRUE )
Regards,
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Who is online
Users browsing this forum: [Ccbot] and 0 guests