Memory Out

General TRichView support forum. Please post your questions here
Post Reply
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Memory Out

Post by Ceprotec »

I'm trying to open the following file.

Image

This file contains 250 images.

But the following error occurs:

Image
Image


Already tried using:
SRichViewEdit1.LoadRVF(Caminho);
and:
rvActionOpen1.LoadFile(SRichViewEdit1.RichViewEdit, Caminho, ffiRVF);
Sergey Tkachenko
Site Admin
Posts: 17291
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

The current version of TRichView loads all images in memory, creating graphic objects for them.
Unfortunately, this problem cannot be solved in the current version of TRichView.
If the document has many identical pictures, some optimizations are possible, but if all pictures are different, this problem is unavoidable.

In future versions, we plan to optimize memory usage for pictures, graphic objects will be created only for the most recently used pictures. But I cannot tell when it will be implemented, sorry.
Sergey Tkachenko
Site Admin
Posts: 17291
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

By the way, images of which type caused this problem?
If this is TGifImage, make sure that you included RVGifAnimate unit in your project, it optimizes memory usage for gif animations.

For any case, please send me a file causing this problem.
Sergey Tkachenko
Site Admin
Posts: 17291
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

One more possible reason for "out of memory" error is a file corruption. So please send me this file for verifying it.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

The images are in JPG.

The file is too large.

I believe that the file is not corrupted, I tried to open it with a demo, but some images were not loaded (it was the same error).

Google Translate, sorry.
Sergey Tkachenko
Site Admin
Posts: 17291
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I thought more about this problem, and probably I can implement a solution.
I'll try to solve it later in this week.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

Ok.

When a very large file is opened, the RAM usage is high, is there any way to free this memory after this file be opened?

Thank you.
Sergey Tkachenko
Site Admin
Posts: 17291
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

The whole content of a file is loaded in memory, it is unavoidable.

The only thing that can do is optimizing working with images. TGraphic object can be created only for several recently used images. For other images, it can be created on demand.

For small documents, it will increase memory usage, because we need to store image both in TGraphic object and in a memory stream. But documents containing many images will require much less memory and resources.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

https://youtu.be/xAuBMQvchQk

Is there any solution to the video problem?
Sergey Tkachenko
Site Admin
Posts: 17291
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

It may be caused either by memory leak or by a bad memory manager in the old version of Delphi.
There are no known memory leaks in the newest version of TRichView.
To understand the problem, I need your file. You can upload it (zipped) to some web server and give me a link. If you need, I can give you ftp account on trichview.com to upload this file.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

I sent the file by PM.
Post Reply