0

I'm using Delphi 6 for developing a client/server application using Indy and COM components, and the response was sent in XML format as a WideString variable. I'm facing an EOutOfMemory exception when the response data was more than 2 GB or 2^30 characters as mentioned in the Embarcadero Site, and I'm trying to convert this 32-bit application to a 64-bit application using Delphi 11 to occupy the available system RAM.

Do I need to change any declaration of WideString to overcome the out-of-memory issue or can I just build the client and server application as 64-bit format?

AmigoJack
  • 5,234
  • 1
  • 15
  • 31
  • Your problem is that a string isn't the correct data type for such a huge response payload. You need to re-define your api first. Changing the process to he 64 bit won't help if the data type you use can't carry the payload. – David Heffernan Jul 31 '23 at 08:07
  • And which variable can i use? Do I need to use any array of char? and how I need to define the array size? – Question stack overflow Jul 31 '23 at 08:15
  • Hard to give concrete advice without knowing more about the system. Seems like this is an out of proc com server so your candidate data types are determined by COM. COM BSTR has a 32 bit length so you can't pass it all in a single BSTR. – David Heffernan Jul 31 '23 at 08:26
  • Why do you have XML that is over 2GB in size?!?! This sounds like a really bad design. In any case, try storing the XML in a UTF-8 string instead, that will effectively cut the memory usage in half, approximately. Indy in Delphi 6 does not support `WideString`, but it does support charset-encoded `AnsiString`. – Remy Lebeau Jul 31 '23 at 20:26

0 Answers0