Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExecutableAllocator: Fix the size of the executable pool to 32MB. #22

Closed
wants to merge 2 commits into from

Conversation

waddlesplash
Copy link
Member

The x86_64 default was 1GB, which winds up wasting a huge
amount of (non-overcommitting) memory on Haiku. 32MB is the
current default on 32-bit, so this is probably fine for everywhere.

The x86_64 default was 1GB, which winds up wasting a *huge*
amount of (non-overcommitting) memory on Haiku. 32MB is the
current default on 32-bit, so this is probably fine for everywhere.
@waddlesplash
Copy link
Member Author

I didn't merge this because I don't know if you want to put it in some other config header or something. But this makes Web+ usable again on x64 systems with not a lot of swap...

@pulkomandy
Copy link
Member

Can we make it use overcommited memory?

@pulkomandy
Copy link
Member

So, after digging a bit, this should really be uncommitted memory. I expect the large area is there for performance reasons (it's better to create a single area and do everything inside it).

Eventually the allocation is done through Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp , reserveUncommitted, which has a special case on Linux to use mmap with the NORESERVE flag. It also attempts to use madvise but we provide only posix_madvise.

So either we need to add NORESERVE to our mmpa implementation, or create an OSAllocatorHaiku that uses areas instead of mmap.

Moreover, if we still want to change the size of this, we should do it in PlatformHaiku.cmake as it is done for the Playstation port which forces 64MB (possibly because they use FreeBSD and also don't have the overcommitting).

Fixing this means we save 1GB on 64bit, but also at the same time save 32MB on 32bit, which is also welcome, I think? So we can brag about our low memory use everywhere? :)

@waddlesplash
Copy link
Member Author

0c2fde4 supplants this.

@waddlesplash waddlesplash deleted the waddlesplash-patch-1 branch August 4, 2019 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants