×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

MTS returns out of memory when returning 270 records

MTS returns out of memory when returning 270 records

MTS returns out of memory when returning 270 records

(OP)
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

RE: MTS returns out of memory when returning 270 records

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.

RE: MTS returns out of memory when returning 270 records

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

RE: MTS returns out of memory when returning 270 records

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.

RE: MTS returns out of memory when returning 270 records

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close