Memory leak's at big text data #88

Open
opened 2023-02-26 10:55:37 +00:00 by Hadgehogs · 0 comments
Hadgehogs commented 2023-02-26 10:55:37 +00:00 (Migrated from github.com)

Hello.
I parse a big data files and i catch a memory leak after TFLRE.Free() like this:

изображение

At Eureka mem leak log it's see like this:
изображение
изображение

I inspect, what count of execution of this block
изображение

is more, than count of execution of this block:

изображение

and i change free memory block to this code:

 for State in AllStates do begin
  if not Assigned(State) then
    Continue;
  SetLength(State^.SubMatches,0);
   Finalize(State^);
  FreeMem(State);
 end;
 FreeStates:=nil;

Memory leak is gone out. Does it's right decision?
Sorry for my bad English, it's not my native language.

Hello. I parse a big data files and i catch a memory leak after TFLRE.Free() like this: ![изображение](https://user-images.githubusercontent.com/40996325/221405723-d7aef18a-f75b-4da5-979a-1953a386b314.png) At Eureka mem leak log it's see like this: ![изображение](https://user-images.githubusercontent.com/40996325/221405877-cebc3e47-3773-4dbb-b6cd-d20f667d5b94.png) ![изображение](https://user-images.githubusercontent.com/40996325/221405891-7793f35a-c338-42c8-bdc7-b91c8ee4f7f2.png) I inspect, what count of execution of this block ![изображение](https://user-images.githubusercontent.com/40996325/221405949-6bdece73-217e-49e7-9b9e-3d29ef906d60.png) is more, than count of execution of this block: ![изображение](https://user-images.githubusercontent.com/40996325/221406038-50f11eba-b1af-4013-9950-003e7ab7f3d7.png) and i change free memory block to this code: ``` for State in AllStates do begin if not Assigned(State) then Continue; SetLength(State^.SubMatches,0); Finalize(State^); FreeMem(State); end; FreeStates:=nil; ``` Memory leak is gone out. Does it's right decision? Sorry for my bad English, it's not my native language.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BeRo1985/flre#88
No description provided.