?
Solved

NotesStream

Posted on 2011-03-22
7
Medium Priority
?
650 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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.

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
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

743 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