Questions tagged [allocate]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer

Handling out of memory issues in heap

We have a CPI that uses ~4000 bytes of heap, and it executes a few times in a loop, so for a few executes the program will fail with memory allocation failed, out of memory. The solution has been to ...
Whiteseal's user avatar
  • 2,893
1 vote
1 answer

How to calculate space for an account dynamically using remaining_accounts

Is it possible to allocate space to an account based on account provided in remaining_accounts? I want to allocate enough space to store public key of the accounts provided in remaining_accounts in a ...
onurhb's user avatar
  • 113
3 votes
1 answer

What is the memory usage limit on solana's programs?

What is the maximum memory that a solana program can allocate before throwing an out of memory exception, and how is it handled during the program's execution? Is this documented anywhere, like the ...
0xGhohun's user avatar
1 vote
1 answer

Is it possible to write a custom allocator at all? where do I store internal data structure?

Static writable data is not supported. I could store it in the heap itself, only if there is some way to store a flag indicating if initialization is called. Has this ever been done before? This is ...
oxfeeefeee's user avatar
1 vote
1 answer

Allocate data on memory region

I have initilized a PDA with 10000 bytes of space and a Vector on its stored data: #[derive(Accounts, Clone)] pub struct CreateVectorPda<'info> { /// CHECK: Just testing #[account(mut)] ...
user3688985's user avatar