Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#40 Memory release

open
nobody
None
5
2014-03-27
2012-06-19
Damon
No

Hi,

I\'m using jacob to parse a big file.
The codes look like :

try
{
ComThread.InitSTA(true);

while (xxxx)
{
Dispatch record= Dispatch.call(xxxx, \"xxxx\", itemIndex)
....
record.safeRelease();
}
}
finally
{
ComThread.Release();
}

The problem is that, the file is really big, the while loop is generate lot\'s of record Objects which are refered by ROT.
Since the GC can\'t release the record objects, the memory group quickly.

I think ComThread.RemoveObject may slove the problem, but it is Deprecated.

Or it would be good ROT should remove the object when record.safeRelease() is called.

Discussion

  • I also find original Jacob unusable for such cases. I sent a patch to help this, but it was rejected just 4 days ago. If you can patch jacob and build it by yourself, you may find this solution applicable.

    https://sourceforge.net/p/jacob-project/patches/39/