Improve company productivity with a Business Account.Sign Up



Posted on 2011-03-22
Medium Priority
Last Modified: 2013-11-17

I have a requirement of storing 25 different long strings.  They are too long for me to store them as strings I will therefore have to declare 25 NotesStream objects. Is there any other way that I can store these 25 strings? Will it affect the performance if I declare 25 stream objects in a single agent?
Question by:jenvin
  • 4
  • 3
LVL 22

Expert Comment

ID: 35189139
RE: "They are too long for me to store them as strings"
Are you sure?  The max size of string in LotusScript is 2GB.

RE: "Is there any other way that I can store these 25 strings?"
If they are larger than 2GB, then no.

RE: "Will it affect the performance if I declare 25 stream objects in a single agent?"
Of course, but it's a give and take situation.  If you open 25 streams at once, you should get better performance at the cost of more memory usage.  If you process the streams sequentially, you should have slower performance, but use less memory.

Author Comment

ID: 35189388
How do i check how much memory the agent is using. If I delete all the streams in the end then do you think it will matter?
LVL 22

Expert Comment

ID: 35190077
RE: "How do i check how much memory the agent is using?"
Use the Lsi_Info function to return running environment info...

Lsi_info(50) = Total LotusScript Memory Allocated
Lsi_info(51) = Total LotusScript Memory Allocated from OS
Lsi_info(52) = Total LotusScript Blocks Used

Save these values before processing, then check during or after processing.

RE: "If I delete all the streams in the end then do you think it will matter?"
Pretty vague question.  Yes, it will matter - but matter to what?  You should always delete all objects after use anyway (helps LS with GC - LS GC is a bit lazy).  The only way to know for sure is to code them both and test with representative data.  Make a graph of run time vs memory usage, run many times, average your data and decide.  There's no right answer - it all depends on the specific data and how it's being used.

FYI: I tend to code towards performance and ease of code maintenance first, then I tweak the code if it uses too much memory.  You can always throw more resources at a server to get performance back.
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!


Author Comment

ID: 35196069
Thanks. I was not aware of how we track the memory. I am sure this information is going to be very helpful to all developers. Let me do my study and I will update you. Thanks for the help

Author Comment

ID: 35279440
I ran the code before and after running the agent Everytime the memory displayed is different Is there a way to know if my agent is having a memory leak?
LVL 22

Accepted Solution

Bill-Hanson earned 750 total points
ID: 35282948
Like this...

startingMemory = Lsi_info(50)
' ... do something ...
currentMemory = Lsi_info(50)
memoryDiff = currentMemory - startingMemory

Open in new window

memoryDiff should be zero if everything was returned to the OS.  One of the problems with LotusScript is that you never know when garbage collection is performed.  There's no way to force it, but setting your objects to Nothing when you're done using them is a best practice.  Due to the way GC is performed, you'll probably never see memoryDiff equal to zero.

If I were you, I'd just code it using the 25 streams and be done with it.

Author Closing Comment

ID: 35475062
Thanks for the help

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Watch the video to know the process of migration of Exchange or Office 365 mailboxes in absence of MS Outlook. It is an eminent tool which can easily migrate Public, Archive user mailboxes from one another Exchange server and Office 365. Kernel Migr…
Watch the working video to know how to import Outlook PST/OST files to Amazon WorkMail. Kernel released this tool which is very easy to use and migrate single or multiple PST and OST files to Amazon WorkMail. To know more about Kernel Import PST to …

608 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question