Jump to content

limelect

Members
  • Content Count

    924
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by limelect


  1. OK everybody first THANKS 

    LASTLY, I hope no one is angry at me.

    And this made memory almost still

     

    I added a ValidateDB. from the Internet

     

    function ValidateDB : String;
    var
      goodsqlitedb : Boolean;
      FDPhysSQLiteDriverLink2 : TFDPhysSQLiteDriverLink;
      FDSQLiteValidate2 : TFDSQLiteValidate;
      FDPhysDriverService : TFDPhysDriverService;
      FDSQLiteSec2 : TFDSQLiteSecurity;
    begin
      Result := 'Undefined';
      try
        goodsqlitedb:=true;
        Form1.ListBox1.Items.Clear;

        //FDSqliteConn.Open;
        FDPhysSQLiteDriverLink2:=TFDPhysSQLiteDriverLink.Create(nil);
        FDSQLiteValidate2:=TFDSQLiteValidate.Create(nil);
        FDPhysDriverService:=TFDPhysDriverService.Create(nil);
        FDSQLiteSec2:=TFDSQLiteSecurity.Create(nil);
        FDSQLiteSec2.DriverLink := FDPhysSQLiteDriverLink2;
        FDSQLiteValidate2.DriverLink:=FDPhysSQLiteDriverLink2;

        //FDSQLiteValidate2.OnProgress(FDPhysDriverService,DBMessage);

       //  "with" is evil, so omit it // with FDSQLiteValidate2 do begin
          updatelog( 'To Start the Validation');
          FDSQLiteValidate2.Database := 'Applications.db';
          FDSQLiteValidate2.Analyze;
          updatelog('Database To be Analyzed');
          if not FDSQLiteValidate2.CheckOnly then
              Result:= '1' //Database has problems
          else
              Result:= '0'; //Database is good
        //end;
      except
        on E: Exception do  begin
                  updatelog( 'Database Exception='+E.Message);
                  Result:= '2';    //Database is Corrupt  
                  goodsqlitedb := False;                                         
                  //raise;
            end;
        end;

      try
        FDPhysSQLiteDriverLink2.Destroy;
        FDSQLiteValidate2.Destroy;
        FDPhysDriverService.Destroy;
        FDSQLiteSec2.Destroy;
      finally
        updatelog( 'Drivers destroyed');
      end;

    end;
     

    Now, memory stays almost the same while searching.

    One problem my special record now takes almost 5!! minutes to load.

     

     

     


  2. Crazy as it sounds I executed my main program

    Then concurrent I executed my TEST program which it does

    read this record into richedit.

    Well, both programs are in memory and it worked on my test program.

    However, twice the DB as I did not want a lock condition. Just to check

    the loading of the record

     


  3. @sherlock I do not blame but myself.

    I started with Delphi with #1 and before with visual and before 

    with Pascal,c, and more. There were days I wrote with FORTRAN.

    I never had such a problem not even with BDE.

    I just finished making a large program that handles all company need

    with MSSQL. many PC, a lot of electronics, and no memory problems.

    The thing I blame is the components (not Delphi?) as they use a lot

    of memory. Not my Pascal writing and I might be wrong.

    @Lars Fosdal It will be too complicated but I will think about that option.

    What you suggest is when reading to assemble all pictures that were

    in records.

    maybe.

    The only problem I have programs already out there what do I do with them?


  4. @aehimself The DB is NOT the problem. Since data (a record)

    read OK. But the use of it. It finishes the memory.

    @Stano Files are not the problem as they are data.

    In my case, it is pictures and text as they are also data.

    Can be asci or binary does not matter.

    TAdvRichEdit uses this data with no problem


  5. @Lars Fosdal Unfornetly that is what I am doing.

    I filter the database and left in the dbgride with 1 record. It does not matter how many records are left.

    dblclick the record and read the field into the stream. No problem

       AdvRichEditor2.LoadFromStream(MyMemStream);<<< memory problem

     

    before I read the blobe into a string memory error
    It seems I have to redesign my program. because

    at another time the record might even be larger.

    I cannot know how many pictures and text richedit will hold.

     

    P.S what amazed me that insert into db has no problems

     


  6. @programmerdelphi2k Plz stops attacking me it does not help.

    And your demo is useless.

    @Attila Kovacs Debug does not help since I finish my memory

    and I know exactly when it happens when I load a large record.

    It is a program too large to be in memory.

    @Fr0sT.Brutal I know precisely what happens.

    At first time, I thought it was an SQL problem now I know it is a memory problem.

    @skyzoframe[hun] storing pictures into a file very fast I will

    have thousand of them.

    and this is exactly what I do

    "Or use a custom table for blob fields and call only when you have to show the picture."

    I insert it into a DB where I have no problem however bringing the record finishes the memory !!.

     

    P.S an Idea. if I put the form and process into a DLL

    load and unload each DLL (form) will it help for memory?

     

     


  7. @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

×