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

[Feature request] Constant Memory Usage #1262

Closed
KnorpelSenf opened this issue Feb 16, 2023 · 6 comments
Closed

[Feature request] Constant Memory Usage #1262

KnorpelSenf opened this issue Feb 16, 2023 · 6 comments
Labels

Comments

@KnorpelSenf
Copy link
Contributor

Clear and concise description of the problem

Currently, as you add pages to the project, the RAM consumption will grow and grow. Already with a few hundred pages, the default amount of RAM available to Node is insufficient.

Suggested solution

Build the site page by page with a memory overhead that scales with the size of the largest/most complex page, rather than with the number of pages.

Alternative

Allow building the site incrementally based on the cache, so only the assets that have changed must be rebuilt. That way, we could use caching in CI and still be able to build the site. This is probably less favorable because it means that builds now depend on an external cache.

Additional context

There are systems like https://lume.land/ that require no build step at all. I understand that this is not really possible to do anymore with where Vuepress is at today. However, it would still be nice if we could use at least less resources than we currently do.

@Mister-Hope
Copy link
Member

Mister-Hope commented Feb 21, 2023

Your question is reasonable.

During the build process, this cannot be done, webpack and vite all need to load and analyze all codes to pack the application, this means the more you put inside a project, the more codes they need to handle, so the compiling stage needs a linear space of memory comparing to content. These memory are taken by bundler, and it's not quite related to VuePress itselfs, unless we do not require a bundler to pack our spa anymore.

During the SSG process, we should ensure all previous contents can be "GC"ed when generating a new page, and I think that vuepress official plugin and default theme is doing a great job here. If you notice that memory usage keep increasing when rendering page htmls, then there might be some issues in 3rd party plugins and themes.

@KnorpelSenf
Copy link
Contributor Author

Thanks for responding. Do I understand it correctly that this would have to be fixed in both webpack and vite before we could achieve this?

It's great to see vuepress itself doing a better job :)

@github-actions
Copy link

github-actions bot commented Mar 9, 2023

This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 7 days.

@KnorpelSenf
Copy link
Contributor Author

KnorpelSenf commented Mar 25, 2023

Maybe add a different label to prevent the bot from marking this issue as stale.

@github-actions github-actions bot removed the stale label Mar 25, 2023
@github-actions github-actions bot added the stale label Apr 10, 2023
@Mister-Hope Mister-Hope reopened this Apr 17, 2023
@vuepress vuepress deleted a comment from github-actions bot Apr 17, 2023
@vuepress vuepress deleted a comment from github-actions bot Apr 17, 2023
@Mister-Hope Mister-Hope added discussion Discussion and removed stale labels Apr 17, 2023
@github-actions github-actions bot added the stale label May 3, 2023
@github-actions
Copy link

github-actions bot commented May 3, 2023

This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 7 days.

@Mister-Hope Mister-Hope removed the stale label May 3, 2023
@github-actions github-actions bot added the stale label May 19, 2023
@vuepress vuepress deleted a comment from github-actions bot May 19, 2023
@Mister-Hope Mister-Hope removed the stale label May 19, 2023
@github-actions github-actions bot added the stale label Jun 4, 2023
@github-actions
Copy link

github-actions bot commented Jun 4, 2023

This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants