trichview.support
memory usage |
Author |
Message |
Michael Philbrick |
Posted: 03/14/2005 1:29:24 Sergey, I am having an issue similar to the "memory usage problem" newsgroup post of Friday 28 Feb 2003. Consider the following code: procedure TfmRecordBreaker.Button1Click(Sender: TObject); rvComm.Clear; rvComm.Format; rvComm.InsertRVFFromFileEd('c:\test.rvf'); end; This is the simplest I could get the code to reproduce the problem. In my actual code, I call LoadRVFFromStream multiple times to build the main document, headers and footers for print preview. I noticed that each time the document was displayed, my application increased its Mem Usage in Windows Task Manager by 40-150K. The values just continued to rise and eventually the performance of the LoadRVFFromStream method suffered, taking 5-10 seconds to run. I noted in the newsgroup thread that you could not find any memory leaks. I then decided to try this with your RVEditDemo.exe application. I opened the sample document, readme.rvf, about 30 times in a row, sometimes clearing the document in between loads, sometimes not (this didn't seem to make a difference). Watching the memory usage I noticed that it would creep up two or three times, hold steady for another 4-5 cycles, then creep up again for 2-3 cycles in a row. The end result is that I noticed the same memory creep in your sample application, usually 10-40K at a time. With my application it is magnified tremendously because I use a lot of RichViewEdit componenents simultaneously. I also noticed that when my print preview richviewedit controls were placed on a modal form, where the form had to be created, opened and destroyed each time I wanted to display the document, the "memory creep" disappeared. Therefore, it appears that the additional memory that is being allocated is not actually "lost" but is freed correctly when the component is destroyed. This increased use of memory causes major performance issues the longer the application is open, so a solution is very important. Please let me know if you need any other information. Michael Philbrick |
Powered by ABC Amber Outlook Express Converter