To Andre Guirard: question concerning delete in LS

Hi Andre,

you pointed out that delete is a useful technique to free memory in agents that run on a lot of documents, navigating through them with getfirstdocument and getnextdocument.

e.g. here http://www-10.lotus.com/ldd/nd6forum.nsf/c21908baf7e06eb085256a39006eae9f/378caf05601e69e7852570ac00749026?OpenDocument

My questions are:

  1. Does this apply to getnthdocument too?

  2. Concerning the referenced post above, I don’t understand why there is just one delete:

Set docNext = coll.GetNextDocument(docCur)

Delete docCur ’ so documents don’t accumulate in cache

Set docCur = docNext

Wouldn’t I need to also delete docNext? I think that if there’s no delete, instead of docCur flooding the memory, docNext does it.

  1. Bob Balaban just published on his blog that “the LotusScript garbage collection mechanism is invoked after every statement”. Does this mean there is a Notes-version that does not need delete anymore? If so which version number is it?

Regards, Olaf

Subject: RE: To Andre Guirard: question concerning delete in LS

Delete statement is not needed in, I think, 6.5.4 and later, 7.0 and later, and 8.0 and later, if what you’re concerned about is boosting performance by reducing the amount of memory in use.

Caching still occurs in newer versions, but it’s less aggressive – it won’t gobble up all your memory.

The Delete statement is still helpful in cases where you know there’s a good chance that the cached value is not up to date – for instance, if you want to compare the NotesDocument in memory being edited, to the version on disk, in a Querysave form event.

Subject: RE: To Andre Guirard: question concerning delete in LS

Let me just send you a big thank you for the quick answer!