COM API out of memory errors on client

I have an application written in VB.NET that uses the client COM API. I am getting frequent crashes and huge memory usage. Before it crashes it writes “Notes Error: Maximum number of memory segments that Notes can support has been exceeded.”

The application examines mail messages, looks up the target mailboxes in the address list, then updates properties of each copy of the mail message. After a while, the Notes Administrator shows that the connections with many open databases, although each NotesDatabase object is explictly set to nothing and the .NET garbage collection is explictly called.

Can anyone explain what is going on?

Does anyone have any suggestions how I can get Notes to close a database connection after it has been opened?

Are there any client or server (Solaris) settings that can control this?

Is there an equivalent to the Java .recycle method?

Thanks in advance…

Subject: COM API out of memory errors on client

GC in .NET doesn’t release external resources, it just cleans up the managed wrappers if the resources are released – take a look a ReleaseCOMObject (in Marshal). That will actually unhook the Notes objects.

Subject: RE: COM API out of memory errors on client

Spot the .Net newbie…

Thanks Stan, that gave me enough to resolve the issue.

Subject: RE: COM API out of memory errors on client

Hi, I read that your problem is solved… I still have a similar problem. I need to create more then 30000 documents and after each document I use ReleaseComObject and free the document object but the only I reached ist to write 12500 documents instead of 10168. I also have some waits and every 5000 loops I Release the session and create a new one… but nothing helps. Maybe you can enlighten me :o)Thank you