Skip to content

[bug][mono] sgen alloc nursery heap size #115045

Open
@srxqds

Description

@srxqds

I have set nursery size use nursery-size=8m.

it will call alloc_nursery pass dynamic_nursery: false min_nursery_size: 8388608(8m), max_nursery_size : 8388608(8m)

alloc_nursery (dynamic_nursery, min_nursery_size, max_nursery_size);

and then:

* sgen_nursery_size <= sgen_nursery_section size <= sgen_nursery_max_size
*/
data = (char *)sgen_major_collector.alloc_heap (max_size, max_size);
sgen_update_heap_boundaries ((mword)data, (mword)(data + max_size));

add last call mono_valloc_aligned, will add size + aligned leading the size to 16m at line 165:

mono_valloc_aligned (size_t size, size_t alignment, int flags, MonoMemAccountType type)
{
// We don't need padding if the alignment is compatible with the page size
if (mono_opt_wasm_mmap && ((MWPM_PAGE_SIZE % alignment) == 0))
return valloc_impl (NULL, size, flags, type);
/* Allocate twice the memory to be able to put the block on an aligned address */
char *mem = (char *) valloc_impl (NULL, size + alignment, flags, type);
char *aligned;
if (!mem)
return NULL;
aligned = mono_aligned_address (mem, size, alignment);

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-VM-meta-monoquestionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions