Hello. Adding the graphics to TRichViewEdit with AddPictureEx method. When calling Clear method, only memory for graphic is deleted. A lot of memory keeps in process memory.
For example: When I add about 5000 of graphic the process eats 250 MB, when I call the Clear method the process eats 42 MB. Even if we cut the process itself (about 2MB ) it still eats a lot of unused memory
How to totally clean up all the items memory?
Free all items memory when Clear
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
When you call Clear method, all memory for document and for formatting is cleared.
All pictures inserted in TRichViewEdit are freed.
I think that the tool you use to view a memory usage displays wrong values (the memory is freed by still shown as used). If you use the Task Manager, this is definitely so.
Try to minimize and restore your application after calling Clear.
All pictures inserted in TRichViewEdit are freed.
I think that the tool you use to view a memory usage displays wrong values (the memory is freed by still shown as used). If you use the Task Manager, this is definitely so.
Try to minimize and restore your application after calling Clear.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
By the way, if you use many identical pictures, consider the following ways to reduce memory usage:
- use image lists ("bullets" and "hotspots" item types)
- duplicate pictures using Assign method rather than loading them from file each time when a new picture is needed; since Delphi implements a "copy on write" mechanism for pictures, all pictures copied by Assign method share the same graphic data.
- use image lists ("bullets" and "hotspots" item types)
- duplicate pictures using Assign method rather than loading them from file each time when a new picture is needed; since Delphi implements a "copy on write" mechanism for pictures, all pictures copied by Assign method share the same graphic data.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: