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?
-
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.– WhitesealCommented Sep 27, 2023 at 19:49
1 Answer
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.