limelect
-
Content Count
775 -
Joined
-
Last visited
-
Days Won
1
Posts posted by limelect
-
-
@skyzoframe[hun] The only way to reduce Is to zip and then open.
I am using advrichedit which holds pictures and text obviously this
move to a database.
There are more options to decrease the size of the picture however
the whole program takes up a lot of space.
However, I am allowing to put a few pictures in the record which will bring back the
size problem.
Maybe the best is to decode as your suggestion to EMF file
However, advrichedit is streamed into the DATABASE so I have
To see how to split the data and use it.
Waaa it starts to be complicated
P.S using ADVrichedit is great as it allows printing in many formats
-
@Fr0sT.Brutal for some reason I did not use Task manager
As you can see the line is almost top of the screen
Any suggestion? Software wise
-
@Fr0sT.Brutal number 4 in my first writing
4. leaving only one large record in the database, NO PROBLEM. Record size 61094574.
Can you elaborate on how to see memory consumption while debugging
do you mean to add software to the source at some points
or there is an IDE tool for that which I never used?
D10.2.3
To make it clear your way might help but how?
I was trying to do what you suggested with vmmap.exe.
I tried a while ago but did not see anything special. all numbers were fixed.
Do you have a simpler tool?
P.S on my test program which has only a grid and button same
logic works which let me assume that components are involved
-
Sorry I cannot help
My test program works with the same logic
-
@programmerdelphi2k Sorry not to agree as since on my test program
with 1 grid and a few buttons, this same database is reading all records
even the large record.
I suspect as the full program has lots of components altogether
are the problem.
Somehow the combination does the problem.
P.S I send you the source for the test program and the database
see the 5'th record and the test read it
-
@Hans J. Ellingsgaard yes by now I tried all combinations.
See above my last resort moving 1 record to memory freeing all
components and using in-memory just 1 record tough large but only 1.
I am left with no choice but to find which component/components
have an impact on the program
I am confident now that it is not only the database since I can insert, delete, change and do any manipulation on it.
except for reading one record under the search condition.
The search condition applies to all records with no problem only the use of 1 record.
P.S all other records can be read (and there are more than 700 of them)
with no problem.
At the beginning of the problem, I started with SQL only then I changed to
combination of table and SQL.
-
Well as a last resort to find what's making the problem
I developed many years ago what I call "scrounge the software"
which means taking parts of the program/or components out
until you reach what is your problem
Obviously, work only on a copy of your program.
A lot of work but worth the self-teaching
-
If someone wants to see Delphi in action goto
https://limelect.com/product-weighing-software-page/
A crystal growing machine 2 years in development with Delphi 4.
A weighing machine with a PC card and Delphi with D6 and 7
And many more.
-
Whoever wants to see which free program we are talking about
https://limelect.com/downloads/document-projects/
The main picture does not show how many pages there are.
Inserting has no problem
-
@aehimself I thought so too. One of my tests was
to delete all components involved
Just one record !!!!
FDMemTable1.CloneCursor(ProjectsFDTable);<< Move record to memory table
// FDMemTable1.RecordCount << check to see if data is inside>>>>>> Close and free all databases and even connections!!!
ProjectsFDTable.Close;
FilesFDTable1.Close;
FDConnection1.Close;
ProjectsFDTable.Free;
FilesFDTable1.Free;
FDConnection1.Free;
FDMemTable1.FieldByName('Description').AsString;<<< Then use the recordor this
MyMemStream:= ProjectsFDTable.CreateBlobStream(ProjectsFDTable.FieldByName('Description'),bmRead);
crazy as it sounds memory problem.
"That should minimize the memory usage." It did not
-
@Daniel all I meant by this thread is that my test program just
a DB grid and a few buttons the LOGIC is OK but on my full program
with the same logic, I have a memory problem.
I did not expect anyone to solve the problem as it is NOT a logic nor an SQL problem
which I thought at the beginning.
but a BIGGER Delphi problem as my main program is full of components
forms and more.
I never saw such behavior with hunters of projects behind me.
This is a warning to the Delphi community about what to expect.
And finally, I hope I am wrong.
P.S I will keep looking into this problem
-
-
@programmerdelphi2k It worked on my test bed but on the real application
as you can see.
Same Database size and content
-
@programmerdelphi2k I do not believe your solution did it.But it did
also, it is on my test program I now will move to my main program
MyMemStream:= ProjectsFDTable.CreateBlobStream(ProjectsFDTable.FieldByName('Description'),bmRead);
AdvRichEditor.BeginUpdate;
AdvRichEditor.LoadFromStream(MyMemStream);
AdvRichEditor.EndUpdate; -
-
-
@VandrovnikFD has unidirectional i tried it allready
when I activate it in the object inspector it gives an error
-
Number 4 in my description
It is a ftBlob
4. leaving only one large record in the database, NO PROBLEM. Record size 61094574.
If I leave 1 record NO PROBLEM. it has nothing to do with DB.
Only the Delphi program This is what I think and I might be wrong
Maybe you have something?
I read the blob into a string then
St := TStringStream.Create(s);
AdvRichEditor.LoadFromStream(St);
If the above works on any small record it is not the logic.
-
1. It will be too complex to split the data as it is text and pictures going into TAdvRichEditor
2. As seen from my explanation I clear all the records and left only with one record big one
And this is OK.
3. I free all the connections and database as it will not have any effects
and left with one record in-memory database that did not help.
This supposes to have smaller program memory. It did not.
4. Once the program uses a large chunk of memory I am stacked with it.
I made hundreds of professional programs making money out of them never had
such behavior.
-
After so many years of successful Delphi, I almost give up
on my free program.
After out of memory I made a new test program and this is what I came up with
1. NO PROBLEM with SQL.
2. I use SQLite for the database.
3. I have a large database.
4. leaving only one large record in the database, NO PROBLEM. Record size 61094574.
5. USING the whole database reading into string s := FDMemTable1.FieldByName('Description').AsString;
make out of memory error. BUT
6. This same instruction works when the table is ONLY this one record. This large record
7. Now for my solution that does not do much. I thought if I free most of the database the program
memory will decrease.So I use the memory table to load 1 record
8. i := FDQuery4.FieldByName('SectionsId').AsInteger;
ProjectsFDTable.Filtered := False;
ProjectsFDTable.Filter := 'FilesIndex=' + IntToStr(i);
ProjectsFDTable.Filtered := True;
FDMemTable1.CloneCursor(ProjectsFDTable); <<< I load the memory database with 1!!!! record.
// FDMemTable1.RecordCount << made sure memory has something>>>>>>>>> I close and free all my tables to be left with 1 record in memory.
ProjectsFDTable.Close;
FilesFDTable1.Close;
FDConnection1.Close;<< even the connection
ProjectsFDTable.Free;
FilesFDTable1.Free;
FDConnection1.Free;
s := FDMemTable1.FieldByName('Description').AsString;<<<< memory error.P.S the above software give me 5 filtered record
Using 4 of them does not make any error only the large one.
I doubt that anyone can help since it is not a database problem but a Delphi PROGRAM problem.
Once I use a database the program memory is large and unmanageable.
Unless someone else thinks differently.
Luckily I do not make money out of this program so I keep searching for solutions for knowledge only.
I think I will move to a different DATABASE as it is my only option.
Or give the user an option to make a new database when it reaches a certain size.
One thing adding records does not have any problems.
I wrote this for the benefit of you the developer to know what is going on with my SQLite database.
-
Tried to help Sorry
-
FMX
uses // RTL System.UITypes, System.Classes, System.SysUtils, // FMX FMX.Memo, FMX.Types, FMX.Graphics, FMX.Controls.Model, FMX.Controls.Presentation; am I wrong?
-
Google search FMX RICHEDITE i found a few
for example https://github.com/DelphiWorlds/KastriFree/blob/master/Controls/DW.RichEdit.pas
-
@Lars Fosdal If I used the logic on SQL I had a memory
problem I used the table to filter with the OR logic. For example
I got 3 records out of 750. Using these records I did the SQL with
SectionsId=FilesIndex' and this did it.
For the time being.
It seems that using tables (if you can) is better at least in my case.
No one can help
in General Help
Posted
Right now from my point of view as a programmer, I catch the screen of a
program as a picture copy to clipboard saves to ADVrichedit so simple.