miguelleeuwe
Programmer
Hi,
We have an application that writes large debug files. At the way it's working, we're assigning strings that everytime become larger. (untill it blows up). I already know it's better to use blobs, but ...
- funny it seems that you'll get a system error indicating that there can be not enough memory allocated, and other times (when the string to be assigned seems to be much larger we simply get a GPF).
- even funnier: In powerbuilder 12 documentation (the one that comes on the CD), I found that Strings can handle lengths up to 1073741823, while checking the help file you'll find a value of 2147483647. (Which I believe to be the correct value?)
Just look for 'standard data types' and you'll find the information:
"String
Any string of Unicode characters with variable length (0 to 1073741823)."
- Now, the real problem I have is not even the length, as pb 'blows' a lot earlier than by reaching the maximim length allowed. At a value somewhere between 95 and 115 MB, way below
I've tried to use the GlobalMemoryStatusEX() API subroutine (though according to MSDN it's a function returning a BOOL
) and yes .. the available virtual memory and other values seem to decrease, but PB still blows up, a lot before those values go down that much to be able to conclude there's not enough memory available.
I've been reading something about powerbuilder's memory management and reducing environmental variables like HEAP-whatever, but please .. Can anyone open me some doors please on how to handle this?
-on a C++ forum I read: "There is no direct way of knowing, since the amount available is varying all the time. The only reliable way is to try to allocate the memory and test whether it successfully allocates or not."
That would be a fine solution in PB if I only knew HOW we could 'try to allocate memory without getting a system error'. Any API function maybe?
The only thing that occurs to me is simply assign the string and to check the system error event and avoid closing down the aplication but this is not recommended by Sybase.
TIA for any help
regards,
Miguel L.
We have an application that writes large debug files. At the way it's working, we're assigning strings that everytime become larger. (untill it blows up). I already know it's better to use blobs, but ...
- funny it seems that you'll get a system error indicating that there can be not enough memory allocated, and other times (when the string to be assigned seems to be much larger we simply get a GPF).
- even funnier: In powerbuilder 12 documentation (the one that comes on the CD), I found that Strings can handle lengths up to 1073741823, while checking the help file you'll find a value of 2147483647. (Which I believe to be the correct value?)
Just look for 'standard data types' and you'll find the information:
"String
Any string of Unicode characters with variable length (0 to 1073741823)."
- Now, the real problem I have is not even the length, as pb 'blows' a lot earlier than by reaching the maximim length allowed. At a value somewhere between 95 and 115 MB, way below
I've tried to use the GlobalMemoryStatusEX() API subroutine (though according to MSDN it's a function returning a BOOL
I've been reading something about powerbuilder's memory management and reducing environmental variables like HEAP-whatever, but please .. Can anyone open me some doors please on how to handle this?
-on a C++ forum I read: "There is no direct way of knowing, since the amount available is varying all the time. The only reliable way is to try to allocate the memory and test whether it successfully allocates or not."
That would be a fine solution in PB if I only knew HOW we could 'try to allocate memory without getting a system error'. Any API function maybe?
The only thing that occurs to me is simply assign the string and to check the system error event and avoid closing down the aplication but this is not recommended by Sybase.
TIA for any help
regards,
Miguel L.