Company: Dalsgaard Data
Contact: John Dalsgaard
URL:
Ссылка скрыта от гостей
Description
Most of you may have discovered memory leaks when your Notes
client is running a large job or just running an application on
the Domino server.
I have seen it in various places - and the sources to the problems
may be almost impossible to identify in your code.
I have come across the following undocumented (as far as I know)
features that can assist you in finding the the malicious code.
Code The basic trick is to know the name of a function call to some
internal registers that will return the information needed:
LotusScript Memory Allocated: Lsi_info(50)
LotusScript Memory Allocated from OS: Lsi_info(51)
LotusScript Blocks Used: Lsi_info(52)
Now if you want to use this code in a foreground agent it could
look like this:
Код:
Sub Initialize
Msgbox(" Total LotusScript Memory Allocated: " + (Lsi_info(50)))
Msgbox(" Total LotusScript Memory Allocated from OS: " +
(Lsi_info(51)))
Msgbox(" Total LotusScript Blocks Used: " + (Lsi_info(52)))
End Sub
To find out if there is a leak you will have to run the code
BEFORE and AFTER the code that you want to investigate.
If you want to use the code in a background agent you would have
to print to the LOG.NSF by using code that looks like this:
Код:
Sub Initialize
Print "Memory Allocated: " + Str$(Lsi_info(50)) + Chr$(10) + Chr
$(13)
Print "Total LotusScript Memory Allocated from OS: " + Str
$(Lsi_info(51)) + Chr$(10) + Chr$(13)
Print "Total LotusScript Blocks Used: " + Str$(Lsi_info(52)) + Chr
$(10) + Chr$(13)
End Sub
Be careful if you write the information to a document in a
database (say your own log facility) since this does also consume
some memory and thus the BEFORE and AFTER measurements are NOT
going to be equal.