Crash when using large String or Blob

Symptom

PowerBuilder crashes when loading large data over 250 MB in a string or a blob

Environment

PowerBuilder

OS: All Windows platforms

Reproducing the Issue

This code crashes

ulonglul_size
lul_size = 1024 * 1000
string ls
int li

        for li = 1 to 256
    ls += space (lul_size)
loop

Cause

This is not a PowerBuilder issue but a 32-bit limitation of the Microsoft Windows memory indexing.

Similar C# code as PowerBuilder's one crashes:

            int li;
            string large = "";
            string ls_10mg = "";
            ls_10mg = ls_10mg.PadRight(iul_mb, 'x');

                   for (li = 1; li <= 500; li++) {
                large += ls_10mg;
            }

The same code works when compiling a 64-bit executable as well with C# as with PowerBuilder

Solution

Use a PowerBuilder 64-bit executable.