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

work in progress: Mem cache and dependency res. improvements etc. #9334

Closed
wants to merge 4 commits into from

Conversation

bep
Copy link
Member

@bep bep commented Dec 30, 2021

TODO(bep) improve commit message.

Hugo has always been a active user of in-memory caches, but before this commit we did nothing to control the memory usage.

One failing example would be loading lots of big JSON data files and unmarshal them via transform.Unmarshal.

This commit consolidates all these caches into one single LRU cache with an eviction strategy that also considers used vs. available memory.

Hugo will try to limit its memory usage to 1/4 or total system memory, but this can be controlled with the HUGO_MEMORYLIMIT environment variable (a float value representing Gigabytes).

A natural next step after this would be to use this cache for .Content.

Fixes #8307
Fixes #8498
Fixes #8927
Fixes #9192
Fixes #9189
Fixes #7425
Fixes #7437
Fixes #7436
Fixes #7882
Updates #7544
Fixes #9224
Fixes #9324

@bep bep force-pushed the new-key-structure branch 4 times, most recently from d5a3148 to 2406e8d Compare January 1, 2022 17:14
bep added 4 commits January 5, 2022 16:29
TODO(bep) improve commit message.

Hugo has always been a active user of in-memory caches, but before this commit we did nothing to control the memory usage.

One failing example would be loading lots of big JSON data files and unmarshal them via `transform.Unmarshal`.

This commit consolidates all these caches into one single LRU cache with an eviction strategy that also considers used vs. available memory.

Hugo will try to limit its memory usage to 1/4 or total system memory, but this can be controlled with the `HUGO_MEMORYLIMIT` environment variable (a float value representing Gigabytes).

A natural next step after this would be to use this cache for `.Content`.

Fixes gohugoio#8307
Fixes gohugoio#8498
Fixes gohugoio#8927
Fixes gohugoio#9192
Fixes gohugoio#9189
Fixes gohugoio#7425
Fixes gohugoio#7437
Fixes gohugoio#7436
Fixes gohugoio#7882
Updates gohugoio#7544
Fixes gohugoio#9224
Fixes gohugoio#9324
Fixes gohugoio#9352
Fixes gohugoio#9355
Fixes gohugoio#9343
@bep bep force-pushed the new-key-structure branch from ef70c3b to 70a0c79 Compare January 5, 2022 21:52
@bep
Copy link
Member Author

bep commented Jan 5, 2022

I'll reopen this a little later.

@bep bep closed this Jan 5, 2022
@github-actions
Copy link

github-actions bot commented Jan 6, 2023

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.