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

Server Crashes When building project due to high memory usage #3865

Open
smit245 opened this issue Dec 21, 2023 · 1 comment
Open

Server Crashes When building project due to high memory usage #3865

smit245 opened this issue Dec 21, 2023 · 1 comment

Comments

@smit245
Copy link

smit245 commented Dec 21, 2023

I was reading this issue in closed issues section and i was facing the same issue in my project as well
We are unable to build the project in 16GB RAM.
It takes more then hour in local machine mostly.
On server it doesn't even compile and runs out of memory.

Suggestion
When we tried to build our project with -v argument then it takes too much RAM for gen (gen = ent generated code folder) folder compilation or sometimes it takes too much RAM in some other folder which is using gen folder
so,
if we can move the schema table specific files from the gen directory to respective schema table folders in gen then it will not compile all together and memory usage will be reduced

In gen folder probably 5 files are generated per schema table and we have around 257 schema tables in database and we have generated 5 files per table so there will be more then 257*5=1285 files in gen folder only and there is a mutation.go file which takes so much time and RAM(my local machine hangs with SSD and 16GB RAM) just to open it in the editor(IntelliJ).

So if we can move the specific files to their respective folder then it might not compile all together and may compile folder by folder so it will take lesser RAM to compile

Go Version 1.21
Driver MySql
Ent 0.12.4

@nibbleshift
Copy link

Have you found a resolution to this? I am having the same issue.

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

No branches or pull requests

2 participants