Skip to content

32Bit Processes - maximum usable memory #996

@Markus87

Description

@Markus87

How much memory should I be able to use on a 32Bit process with mimalloc?

Given the simple example:

struct SingleMByte{
	uint8_t bytes[ 1024 * 1024 ];
};
std::vector< std::unique_ptr< SingleMByte > > allTheMBytes;
while( 1 )
{
	std::this_thread::sleep_for( std::chrono::milliseconds{ 25 } );
	for( auto step = 0; step < 10; ++step )
		allTheMBytes.push_back( std::make_unique< SingleMByte >() );
	std::cout << allTheMBytes.size() << " MBytes allocated" << std::endl;
}
System Allocator Usable memory [MBytes]
Windows 32Bit default 1890
Windows 32Bit mimalloc 2.1.9 1490
wasm32 emsdk 4.0.0 default 4090
wasm32 emsdk 4.0.0 mimalloc 2.1.7 2920

Is this expected?
Is there a way to improve on that?

If I check the process with System Informer on Windows when it runs out of memory I see this:

Details

Image
Image

How can the difference between the commit and the work set size be explained?

This issue is a result of this discussion: emscripten-core/emscripten#20936 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions