T O P I C R E V I E W |
adyble |
Posted - Mar 10 2025 : 05:48:07 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 |
4 L A T E S T R E P L I E S (Newest First) |
xequte |
Posted - Mar 17 2025 : 22:14:59 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
|
adyble |
Posted - Mar 17 2025 : 05:19:41 the only way we could free the RAM was using MainHandle := OpenProcess(PROCESS_ALL_ACCESS, false, GetCurrentProcessID) ; SetProcessWorkingSetSize(MainHandle, $FFFFFFFF, $FFFFFFFF) ; CloseHandle(MainHandle); |
adyble |
Posted - Mar 11 2025 : 04:45:07 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. |
xequte |
Posted - Mar 10 2025 : 19:42:49 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
|