Solved

NotesStream

Posted on 2011-03-22
7
637 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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 250 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 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