ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 ImageEN holding onto RAM
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

adyble

United Kingdom
10 Posts

Posted - Mar 10 2025 :  05:48:07  Show Profile  Reply
We are scanning like this.

ImageEnView1.IO.SaveToStream(ImageStream, ioJPEG);

We then insert that stream into a database record.

When we close the form, the RAM usage that’s increased form the scan has not decreased. So the next time we open the form and scan, it just carries on adding to the RAM usage until it crashes.

We’ve naturally done - FreeAndNil( ImageStream );

We can destroy the ImageEN component but then get access vilations.

Is there a way to clear the memory uised by the image after its used?

Thanks

Andy

I tried you suggestion -ImageEnView1.Blank ; I put in form.close
However, from the on, until the application is restarted the ImageEnView1 is turned off and doesn't show anyting or allow scanning .

Andy

xequte

38899 Posts

Posted - Mar 10 2025 :  19:42:49  Show Profile  Reply
Hi Andy

So the TImageEnView is in a sub-form? Do you free that form after usage, or is it only created once?

I can't see why ImageEnView1Blank() should prevent scanning from working. Try calling ImageEnView1.Update() after scanning (as a test, it should not actually be needed).


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

adyble

United Kingdom
10 Posts

Posted - Mar 11 2025 :  04:45:07  Show Profile  Reply
Yes, the form is freed with FreeAndNil


We are going to test without the database, so just keep loading images into the view and see if it changes.
Go to Top of Page

adyble

United Kingdom
10 Posts

Posted - Mar 17 2025 :  05:19:41  Show Profile  Reply
the only way we could free the RAM was using
MainHandle := OpenProcess(PROCESS_ALL_ACCESS, false, GetCurrentProcessID) ;
SetProcessWorkingSetSize(MainHandle, $FFFFFFFF, $FFFFFFFF) ;
CloseHandle(MainHandle);
Go to Top of Page

xequte

38899 Posts

Posted - Mar 17 2025 :  22:14:59  Show Profile  Reply
Sorry, I'm not sure what you are seeing there and I suspect it is not related to ImageEn.

Are you able to create a small demo that reproduces the issue (with no database dependencies)?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: