Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MTS returns out of memory when returning 270 records

Status
Not open for further replies.

stevetodd

Programmer
Apr 25, 2001
3
GB
I have an ASP page which calls an MTS VB business object which in turn calls a VB Data object. This is not rocket science of course, however, when the data object returns about 270 records, the business object does not return these records to the ASP page, instead it hangs around quietly rotating until it returns an out of memory error. But, if I call the data component directly from the web page it works fine !! Anyone have any ideas why this should happen ?

Cheers

Steve
 
Steve,
Have you got your problem sovled yet? I have a similar problem recently:
Within MTS, returning Out-of-Memory when processing a table with over 20K records via ADO. It worked fine if I ran it locally without MTS.
If you have any advancement, please let me know as well.
 
Hi there.
I also have had some experience with this out of memory.
I found that mine was due to other instances of the MSDTC service running for some reason. When my components started sitting there just spinning I checked task manager/processes and sure enough there were other instances.
Initially closing all instances and restarting the service seemed to help but in the end I removed and reinstalled MTS and it's worked fine ever since [rapidly finds the needed piece of wood to touch caringly]
Might be worth a look.
Give a man a program and tomorrow he will be hungry.
Teach a man to program and he will never hunger again.
--Sunr¿se

 
Hi Guys,
Basically this problem occurs when the code is not realeasing all the memory whcih it is blocking.
Even i had the same problem in my application. My ASP page was calling MTS component, which in turn was calling another Data Component.And it always used to give me "out of memory" whenever the no. of records exceed some thousands. Then we decided to break the pages into 1k of each ( i know it was not a solution) But again it used to give the same error. Then we revisited all the components, added setcomplete method of MTS component , Released all the memory wherever it was not getting ( especially in acse of strings:-BSTRs in VC++)
Just for the information , for those who use VC++ components , always use TCHAR2BSTR to free BSTR instead of normal declaration as it alllocates double memory.
In vb the problem might be with objects(setting all of them to nothing).
Basically we located memory leaks in the code and fixed them.
And believe me it started working for 10k records. Till now the no has not exceeded this limit. And it is abs. working fine.
 
Hi,

WE also have faced MTS "Out Of Memory Errors" .and were finally able to solve it.

Here are my observations regarding the problems faced by

"stevetodd".

1) Release BSTR(use SysFreeString)
2) Release VARIANTS (use VariantClear);
3) Call SetComplete to release MTS IObjectContext Interface
footpront
4)Release unwanted SAFEARRAYS(SafeArryDestroy)

5) If coding through VB use "SET OBJECT = NOTHING" appropriately, where OBJECT is the proviously instantiated
COM/ActiveX object. This is a must where
TRANS ATTRIBUTE = "Requies a Transaction"

6)IMP - Do not use Global variables /arrays in MTS code to hold class workiog set values, use class variables, it may be catastrophic specially when the data chunk that you are returning are kept in intermidiate global vars.

I think most of these, you are aware of, but just in case you need that.

Thanks and regards,

Partha Pratim Mukherjee,
Compaq India.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top