3

When I use the requestHeapFrame instruction to request more heap, I expect it likely adds additional cost to my transaction. How do I calculate how much additional cost it would take?

1
  • Just want to point out that as of right now, September 2023, the requestHeapFrame ix doesn't seem to do anything. The heap still goes out-of-memory in the normal amount of space in applications where we have tested it on localnet/devnet, unless this has been updated in the last few weeks.
    – Whiteseal
    Commented Sep 27, 2023 at 19:49

1 Answer 1

3

The requestHeapFrame instruction adds an additional 8 compute units per 32K heap requested.

This means if you have a compute budget instruction for requestHeapFrame and use SetComputeUnitPrice to set the microLamport price to 1 microLamport, you would incur 8 * (heapRequested / 32K) * computeUnitPrice more in microLamports on your transaction.

If you're interested in requesting more heap for your program, you'll have to add some code in order to make it possible to increase the total heap available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.