Overview
Memory Allocation Minimization focuses on reducing the number of calls that request new memory from the runtime memory manager. In the cited RISCV-DV/eUVM discussion, every memory allocation, regardless of size, may require several microseconds of runtime-manager processing. The performance issue is therefore tied strongly to allocation frequency, not only to the total amount of memory ultimately used.
Example: formatted immediates
The evidence describes a RISCV-DV instruction-randomization path where a RISC-V instruction's 32-bit immediate value is converted to a decimal string during post_randomize. In SystemVerilog, $sformatf is used to produce the formatted string. Because strings are variable-size arrays, $sformatf must allocate memory to return the string to the caller.
eUVM approach
The eUVM implementation avoids this trivial allocation by using a fixed-size character buffer inside the riscv_instr object. Since a 32-bit number formatted as a decimal string requires at most 10 characters, the implementation declares a fixed-size char array, imm_str_buffer, as part of the object. Because the buffer size is fixed, it is allocated with the containing class object rather than through a separate formatting-time allocation.
The D language, on which eUVM is built, provides two formatting styles in the cited discussion:
format, which behaves like SystemVerilog$sformatfby returning a formatted string.sformat, which lets the user provide scratch memory where the formatted result is written, returning a pointer to the character array.
The eUVM example uses sformat with the preallocated scratch buffer and then casts the result to a string before storing it in imm_str.
Performance implication
The technique does not necessarily reduce the final amount of memory needed to hold the formatted string. Instead, it reduces the number of runtime allocation calls. In the cited example, the authors state that the total allocated memory eventually remains the same, but the number of malloc calls is reduced by half.