Create a new project add the atsynedit in the projects path place a panel with two buttons inside name the first button btnLoad nad second btnReport, copy paste the code below, create your highlighters where the warning is raised replace the file name in the btnLoadclick with an existing 10MB file press the btnload and then the btnreport. I did not made it in to a single procedure to allow atsynedit to call the appropriate highlighter/parser/lexer methods to give the full effect you can try to scroll the contents after the load and before the report to make sure that the highlighting works as expected.
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls, Clipbrd, atsynedit;
type
{ TForm1 }
TForm1 = class(TForm)
btnReport: TButton;
btnLoad: TButton;
Panel1: TPanel;
procedure btnLoadClick(Sender: TObject);
procedure btnReportClick(Sender: TObject);
private
{ private declarations }
FEdit : TATSynEdit;
FOrigin : TFPCHeapStatus;
FFinal : TFPCHeapStatus;
public
{ public declarations }
constructor Create(aOwner: TComponent); override;
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.btnLoadClick(Sender: TObject);
begin
FOrigin := GetFPCHeapStatus;
FEdit.loadfromFile('10mb.Text.File.log');
end;
procedure TForm1.btnReportClick(Sender: TObject);
var
vMem:String;
begin
FFinal := GetHeapStatus;
vMem := IntToStr(Int64(FFinal.CurrHeapSize - FOrigin.CurrHeapSize));
ShowMessage('Memory Used : '+IntToStr(vMem)+' Bytes');
Clipboard.AsText := IntToStr(vMem);
end;
constructor TForm1.Create(aOwner: TComponent);
begin
inherited Create(aOwner);
FEdit := TATSynEdit.Create(self);
{$MESSAGE WARN 'Add the highlighter code here too.'}
FEdit.Parent := self;
FEdit.Align := alClient;
end;
end.
This should provide a fairly accurate report of the memory used by the highlighters on each file. You could try to load multiple files with the same highlighter, with different highlighters etc and what changes.
Since the heap before loading the data is substructed at the end only the highlighters specific memory should be reported.