Article # 629, added by Geoworks, historical record
| first |
previous |
index |
next |
last |
Dynamic heap space request.
Q. Is there any way for a geode to dynamically request more heap space for itself? I want to allocate a memory block to cache some data, but I won't know how big to make it until the geode actually runs. Instead of adding the worst possible case to the geode's heapspace parameter, I'm wondering if there's a function I can call to inform the system that I'm going to now take more heap than I promised when I launched, so it can decide whether to detach more apps. A. Use GeodeRequestSpace followed by GeodeReturnSpace. This will allow you to reserve an amount of heapspace and then actually acquire it. The parameters for GeodeRequestSpace are 'amount' and 'gh' which is the amount of space required in kilobytes and the GeodeHandle of the application that requires the space. Pass the returned ReservationHandle to GeodeReturnSpace when you're done to make the space available to other applications.