Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8622415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:02:56+00:00 2026-06-12T07:02:56+00:00

The stack looks like this :7576b9bc KERNELBASE.RaiseException + 0x58 :671c57ad ; F:\invariant data –

  • 0

The stack looks like this

:7576b9bc KERNELBASE.RaiseException + 0x58
:671c57ad ; F:\invariant data - not DropBox\3rd_party_vcl\MAD collection\madExcept\Dlls\madExcept32.dll
:671c953f ; F:\invariant data - not DropBox\3rd_party_vcl\MAD collection\madExcept\Dlls\madExcept32.dll
:71a80013 
System._ReallocMem(???,???)
:0040497d @ReallocMem + $45
System._DynArraySetLength
IdIOHandler.TIdIOHandler.ReadFromSource(True,-2,True)
IdIOHandler.TIdIOHandler.ReadLn(#$A,-1,16384,$D3B6FF0)
IdIOHandler.TIdIOHandler.ReadLn(nil)
IdCmdTCPServer.TIdCmdTCPServer.ReadCommandLine($7CC1AFB4)
IdCmdTCPServer.TIdCmdTCPServer.DoExecute($7CC1AFB4)
IdContext.TIdContext.Run
IdTask.TIdTask.DoRun
IdThread.TIdThreadWithTask.Run
IdThread.TIdThread.Execute
:004ccf91 HookedTThreadExecute + $2D
System.Classes.ThreadProc($7A486F84)
System.ThreadWrapper($7BFBEFF8)
:004cce73 CallThreadProcSafe + $F
:004ccee0 ThreadExceptFrame + $3C
:7559339a kernel32.BaseThreadInitThunk + 0x12
:76f39ef2 ntdll.RtlInitializeExceptionChain + 0x63
:76f39ec5 ntdll.RtlInitializeExceptionChain + 0x36

none of which is my code. It loks like INDY code, but I realize that if my code is buggy then the exception can still be thrown somewhere elase as a result of me taking all the memory.

I am running MAD Except with leak detection on. If I run for w hile and close the program, it reports no leak. If I leave the program running for a few hours I get the out of memory exception.

I only have two calls to Create(), both are in timer handlers and I have set the timer duration to one second in order to stres stest. The handlers are pretty simple and always Free() the created object.

Is there anything else I can look at, apart from the code of the timer handlers?

Here’s the code if anyone really needs to see it … these are the only two palces where I Create() an object …

procedure TMainForm.ServerAliveTimerTimer(Sender: TObject);

   var timestamp : LongInt;
       ADConnection: TADConnection;
       theDialogForm : TDialogFormForm;
begin
   ServerAliveTimer.Enabled := False;
   TraceInfo('ServerAliveTimer expired after ' + IntToStr(ServerAliveTimer.Interval div 1000) + ' seconds');

   try
      ADConnection := TADConnection.Create(Self);
      ADConnection.DriverName := 'mysql';
      ADConnection.Params.Add('Server=' + MAIN_STOREROOM_IP_ADDRESS);
      ADConnection.Params.Add('Database=XXX');
      ADConnection.Params.Add('User_Name=XXX');
      ADConnection.Params.Add('Password=XXX');
      ADConnection.Params.Add('Port=3306');
      ADConnection.Connected := True;

   except
      on E : Exception do
      begin
         StopAllTimers();

         TraceError('Database error. Failed to create ADO connection');

         ADConnection.Free();

         theDialogForm := TDialogFormForm.Create(Nil);
         theDialogForm.ShowTheForm('Database problem'+#13+#10+''+#13+#10+
                                   E.ClassName+#13+#10+
                                   E.Message);

         StopTheApplication();
         Exit;
      end;
   end;

   if isMainStoreRoom then
   begin
      CheckIfStoreRoomIsAlive(SECONDARY_STOREROOM_IP_ADDRESS);
   end
   else
   begin
      CheckIfStoreRoomIsAlive(MAIN_STOREROOM_IP_ADDRESS);
   end;

   // Now, update our own timestamp
   try
      timestamp  := GetCurrentUnixTimeStamp();
      ADConnection.ExecSQL('UPDATE server_status SET alive_timestamp="' + IntToStr(timestamp) + '" WHERE ip_address="' + ipAddress + '"');

   except
      on E : Exception do
      begin
         TraceError('Database error. Failed to upate timestamp for ip_address = "' +
                        ipAddress + ' in table "server_status"' + #13#10#13#10 +
                        E.ClassName+#13+#10+
                        E.Message);
         ADConnection.Free();
         Exit;
      end;
   end;

   ADConnection.Free();
   ServerAliveTimer.Enabled := True;
end;     // ServerAliveTimerTimer()

and

procedure TMainForm.CheckEndOfScheduleTimerTimer(Sender: TObject);
   var ADConnection : TADConnection;
       ADQuery : TADQuery;
       secondsSinceMidnight : LongInt;
       timeNow : LongInt;
       today : LongInt;
       checkoutDay : LongInt;
       checkoutExpireTime : LongInt;
       theDialogForm : TDialogFormForm;
       rfidTag : String;
       i : integer;
begin
   CheckEndOfScheduleTimer.Enabled := False;

   ADConnection := Nil;
   ADQuery := Nil;

   try
      TraceInfo('CheckEndOfScheduleTimer expired after ' + IntToStr(CheckEndOfScheduleTimer.Interval div 1000) + ' seconds');

      secondsSinceMidnight := GetSecondsSinceMidnight();
      timeNow := GetCurrentUnixTimeStamp();
      today := timeNow - secondsSinceMidnight;

      ADConnection := TADConnection.Create(nil);
      ADConnection.DriverName := 'mysql';
      ADConnection.Params.Add('Server=' + MAIN_STOREROOM_IP_ADDRESS);
      ADConnection.Params.Add('Database=XXX');
      ADConnection.Params.Add('User_Name=XXX');
      ADConnection.Params.Add('Password=XXX');
      ADConnection.Params.Add('Port=3306');
      ADConnection.Connected := True;

      ADQuery := TADQuery.Create(ADConnection);
      ADQuery.Connection := ADConnection;
      ADQuery.Open('SELECT * FROM tagged_chemicals');
      ADQuery.FetchAll();

      for i := 0 to Pred(ADQuery.Table.Rows.Count) do
      begin
         if ADQuery.Table.Rows[i].GetData('checked_out') = 'N' then
            Continue;

         checkoutDay        := ADQuery.Table.Rows[i].GetData('checkout_day');
         checkoutExpireTime := ADQuery.Table.Rows[i].GetData('checkout_expire_time');

         if (today + secondsSinceMidnight) > (checkoutDay + checkoutExpireTime) then
         begin
            rfidTag := ADQuery.Table.Rows[i].GetData('rfid_tag');

            TraceInfo('End of pouring time for RFID tag (' + IntToStr(secondsSinceMidnight) + ' seconds after midnight');

            ADConnection.ExecSQL('UPDATE tagged_chemicals ' +
                                    'SET checked_out="N", ' +
                                        'checkout_day="0", ' +
                                        'checkout_expire_time="0" ' +
                                 ' WHERE  rfid_tag="' + rfidTag + '"');
         end;
      end;

      ADQuery.Free();
      ADConnection.Free();

   except
      On E: Exception do
      begin
         ADQuery.Free();
         ADConnection.Free();
         TraceError('Databse exception (' + E.ClassName + ') : "' + E.Message + '"');

         theDialogForm := TDialogFormForm.Create(Nil);
         theDialogForm.ShowTheForm('Database error when checking end of pouring time'+#13+#10+''+#13+#10+
                    E.ClassName+#13+#10+
                    E.Message);
      end;
   end;

   CheckEndOfScheduleTimer.Enabled := True;
end;     // CheckEndOfScheduleTimerTimer()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:02:57+00:00Added an answer on June 12, 2026 at 7:02 am

    Try using the Sysinternals tools VMMap and Process Explorer this should tell you where the memory is going.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SOLVED! My Activity Stack looks like this, excuse the rough diagram! A-->B-->C '-->D If
I'm playing with one stack overflow example. This example looks like this: void return_input
I have a setup that looks like this. class Checker { // member data
I have data that looks like this: [{ level: 0, data: 'A', }, {
So I have a PHP stack that looks roughly like this Class Stack {
I am making a top menu, and it looks like this: https://i.stack.imgur.com/5O5G5.png The contact
I have data that looks like this: CUSTOMER_ID OPERDAYSJUL OPERDAYSAUG OPERDAYSSEP ... OPERDAYSJUN 1
I'd like to create a webpage which looks like this: https://i.stack.imgur.com/GYEis.png I can't use
So, I have an image like this: https://i.stack.imgur.com/4zWVL.jpg It always looks like that, although
My console output looks like this: 2011-12-07 02:46:48.051 Calculator[13186:f803] Operand pushed to stack: 23

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.