FileReadString() cause VirtualAlloc failed in large allocator, How to solve it?

 
while(!FileIsEnding(h))
   {
    string str = FileReadString(h); 


   } 

Journal:
2025.06.29 01:40:56.806 MQL5 VirtualAlloc failed in large allocator, size=555032

Experts:

2025.06.29 01:40:56.806 (EURUSD,H1) out of memory in 'MyClass_File.mqh' (1310,15)

The (1310,15) is 

        string str = FileReadString(h); 

=======================
So, How to solve it?


 
Yu Zhang:

Journal:
2025.06.29 01:40:56.806 MQL5 VirtualAlloc failed in large allocator, size=555032

Experts:

2025.06.29 01:40:56.806 (EURUSD,H1) out of memory in 'MyClass_File.mqh' (1310,15)

The (1310,15) is 

=======================
So, How to solve it?



Try the example code from documentation.