Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

NotesStream

Posted on 2011-03-22
7
Medium Priority
?
655 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
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.
0
 

Author Comment

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

Expert Comment

by:Bill-Hanson
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Author Comment

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

Accepted Solution

by:
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.
0
 

Author Closing Comment

by:jenvin
ID: 35475062
Thanks for the help
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

926 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