Forum > Beginners
SynEdit and ATSynEdit clearing lines
TomTom:
What is the correct cleaning method for all lines in ATSynEdit and SynEdit? This is not completely clear to me.
I've done tests and for example, when I enter about 855,000 lines to SynEdit, TaskManager shows that my program uses about 170MB RAM. When I use SynEdit.Clear, the memory consumption drops to about 30MB RAM and the program just after running without adding text to SynEdit takes about 3MB RAM. How do you check what takes 23MB? Or how to release all unnecessary memory?
The same applies to ATSynEdit.
After emptying the ClipBoard, memory usage also decreases but only slightly
Martin_fr:
This is normal for any FPC application.
FPC has a memory manager between your code and the OS.
Your code (and either edit, or any other component request memory from fpc.
Fpc allocates huge chunks from the OS, and then hands them to the code. If the code frees them, the fpc mem mgr, keeps them for later re-use. So your OS does not see this.
This is normally no problem, because every app has its own mem space. The "idle" memory will be swapped to disk and done.
Only if you have no swap space at all on your disk, then this behaviour may be an issue...
On linux, you can use CMem (add as the first entry to the "uses" clause of your "program" / not "uses" of "unit", but "program").
Bart:
CMem is supposed to work unde Windows as well.
Bart
TomTom:
Oh now it's clear :) Thank You for explaining this to me :)
I could not decide what to use in the project (ATSynEdit or SynEdit). In the second one I miss only WordWrap (and maybe MultiCaret) but I think I can live without it. Using SynEdit is much more simple :)
Thanks again :)
Martin_fr:
TSynEdit indeed has no word wrap.
But it does have multi caret. It comes as a plugin and currently cannot be added via the designer. You need to add it in your code.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- TSynPluginMultiCaret.Create(SynEdit);
I have no experience with AtSynEdit, so I can not compare.
And as the maintainer of TSynEdit, I might be biased anyway....
Navigation
[0] Message Index
[#] Next page