The issues I’ve faced this past 3 weeks have now been proven to me as a NotesUIDocument issue.Specifically, the “Maximum number of memory segments that Notes can support has been exceeded” error.
It looked like there was not enough memory for the notes client to process the screens.
So as a test for freeing up memory, the agent code was adjusted and I created AgentA to run the UIProcessing agent.
AND
The UIProcessing agent was set to operate only a small number of documents.
To try and free memory, each iteration of the loop in AgentA would do a new set UIProcessing = db.GetAgent( “UIProcessing” ) along with a companion Delete UIProcessing at the end of the loop.
But that failed, though in a good way.
When I returned to the Notes client there were about 30 window tabs left open – documents that had been processed but the NotesUIDocument didn’t close!
So the question now is, how can I be certain it’s closed (even ui.close was failing here).
Is this a documented bug?
Collin
KC8TKA
Subject: RE: NotesUIDocument not closing in agent code
You’re deleting the wrong thing and you’re doing it in the wrong place. Deleting the agent from the cache does little to free memory and will only slow performance – since you’re usually about to run that same agent again. The cache is not dependent on a particular agent or other script – the cached objects are shared among all scripts run in the same environment.
It sounds like your real problem is that you have too many windows open. uidoc.Close has an argument to specify that the close should happen immediately. Are you using that?
If that doesn’t help, it’s probably the uidoc that you should be deleting from within the agent code, as well as any NotesDocuments that you accessed.
Subject: RE: NotesUIDocument not closing in agent code
[ ui is here an instance of NotesUIDocument ]I’ve gone back to the original code and added a change
found in the documentation.
ui.close( true )
for immediate closing of the UI document.
This has cured 99% of the issues.
It seems as though, when a class loses scope, that its
contents are flushed, but not it’s relationship to
anything else. And even if I do a
ui.close
the method command is not queued to be executed when
scope is lost. As a result, ui can remain intact.
I’d done a
delete ui
and that DID NOT solve the problem.
So, things are better. Not perfect, but adequate for the customer.
Collin
KC8TKA
Subject: NotesUIDocument not closing in agent code
My question would be why you’re trying to process so many documents in the ui? It’s much more efficient, not to mention faster, to process a set of documents from the back end classes.