PowerBuilder application crashes when it uses too much memory

Symptom

When the PowerBuilder application takes up too much memory, especially close to 2 GB, it crashes easily.

Environment 

PowerBuilder 2017 or later

Cause

A 32-bit Windows application can only have a maximum of 2GB memory, close to which is prone to exceptions and even crashes.

Solution

Solution #1: Deploy the application into a 64-bit EXE.

Solution #2: Use the following tool to increase the maximum memory to 4 GB for your EXE.

https://ntcore.com/?page_id=371

Solution #3: If the data in the DataWindow is too large, it is recommended to set Rows -> Retrieve Options -> Rows to Disk in the PowerBuilder IDE menu for the Data object to reduce the memory usage.