Solved

NotesStream

Posted on 2011-03-22
7
631 Views
Last Modified: 2013-11-17
Hello

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?
0
Comment
Question by:jenvin
  • 4
  • 3
7 Comments
 
LVL 22

Expert Comment

by:Bill-Hanson
Comment Utility
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.
0
 

Author Comment

by:jenvin
Comment Utility
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?
0
 
LVL 22

Expert Comment

by:Bill-Hanson
Comment Utility
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.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:jenvin
Comment Utility
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
0
 

Author Comment

by:jenvin
Comment Utility
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?
0
 
LVL 22

Accepted Solution

by:
Bill-Hanson earned 250 total points
Comment Utility
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.
0
 

Author Closing Comment

by:jenvin
Comment Utility
Thanks for the help
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now