Symptom

Calling the Clipboard() function in a 32-bit PowerBuilder application may cause the application or IDE to terminate when the clipboard contains a very large amount of text (for example, a copied string of approximately 300 MB).

In fact, this issue is not limited to the Clipboard() function. Any operation that processes an extremely large string may also cause the application or IDE to crash. For example, using the FileReadEx() function to read a very large file into a string or BLOB variable may result in the same behavior.


Environment

PowerBuilder 2017 or later


Cause

The Clipboard() function consumes a significant amount of memory when assigning a large clipboard string to a variable.

A 32-bit application has a maximum address space of 2 GB. As memory usage approaches this limit, typically around 1 GB or close to 2 GB, the application may encounter an exception and terminate.


Resolution

Use one of the following workarounds:

1. (Recommended) Use a 64-bit PowerBuilder application, which is not subject to the 2 GB address space limitation of 32-bit applications.

2. Increase the maximum addressable memory available to the 32-bit executable to 4 GB by using the following tool:

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


 

0
0