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

RAM saver #2435

Merged
merged 11 commits into from Sep 11, 2021
Merged

RAM saver #2435

merged 11 commits into from Sep 11, 2021

Conversation

dimkr
Copy link
Contributor

@dimkr dimkr commented Aug 6, 2021

This is a shared library that reduces RAM consumption by tuning malloc() to waste less RAM at the cost of inefficiency and slower operation, using mallopt().

The four applications I'd like to make lighter are Xwayland, Cage, Python (Blueman) and Firefox, and I'm not sure if this solution should be more targeted (for example, prctl(PR_GET_NAME) and call mallopt() only if this process is named python3, Xwayland, cage, firefox or firefox-esr).

Before (x86_64, Xwayland, GTK+ 3):

Screenshot 2021-08-06 10 38 40

After (x86_64, Xwayland, GTK+ 3):

Screenshot 2021-08-06 10 27 20

Before (x86, X.Org, GTK+ 2):

before

After (x86, X.Org, GTK+ 2):

after

On real hardware (this is under QEMU), I believe the effect will be stronger, because this VM doesn't have a Bluetooth adapter (hence, Blueman does less), etc'.

EDIT: RAM usage of 450 MB on x86_64 with Xwayland, Cage, Blueman and Firefox, compared to ~490 MB without this PR.

EDIT 2: same test, about 10% reduction in RAM usage on my Thinkpad X220. Overall, it performs very nicely, and Firefox still feels fast.

@dimkr dimkr marked this pull request as ready for review August 24, 2021 06:22
@01micko
Copy link
Contributor

01micko commented Aug 24, 2021

Looks interesting..

I'm still a bit out of the loop with the house move and all but I'll review soon.

@01micko
Copy link
Contributor

01micko commented Sep 7, 2021

In your opinion, is this useful for the other woof-distros apart from dpup?

@dimkr
Copy link
Contributor Author

dimkr commented Sep 7, 2021

In your opinion, is this useful for the other woof-distros apart from dpup?

Yes, of course. It's a RAM vs. CPU tradeoff, so it's useful for any Puppy where lower RAM usage is important.

@01micko
Copy link
Contributor

01micko commented Sep 7, 2021

Well add Slacko to the list!

@dimkr
Copy link
Contributor Author

dimkr commented Sep 7, 2021

Well add Slacko to the list!

Building feature/ram-saver-slacko (this branch, with ram-saver added to 8.x) now at https://github.com/dimkr/woof-CE/runs/3532896117?check_suite_focus=true.

@dimkr
Copy link
Contributor Author

dimkr commented Sep 7, 2021

8.x already has super low RAM usage, and now it's even lower :)

before

slacko

(The savings will be bigger when Firefox is running)

@01micko 01micko merged commit baf3d07 into puppylinux-woof-CE:testing Sep 11, 2021
@dimkr dimkr deleted the feature/ram-saver branch September 11, 2021 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants