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

Locked up, uses all the memory #278

Open
TurkeyMan opened this issue Aug 28, 2024 · 3 comments
Open

Locked up, uses all the memory #278

TurkeyMan opened this issue Aug 28, 2024 · 3 comments

Comments

@TurkeyMan
Copy link

image

Do we know what causes this? It happens semi-regularly, but I haven't worked out what it is... it seems that maybe evaluating a particular expression that it doesn't like causes this.

@TurkeyMan
Copy link
Author

It kept complaining about a particular variable in scope... that struct had a union, and an alias this, i thought maybe it was too complicated, so i worked through and simplified the struct to test, and then when i removed basically everything from the struct, it stopped complaining about that struct, and locked up saying it was evaluating this instead, and I couldn't easily do the same process there... but it was weird to note that it complained about one thing, and when I eliminated it, it just complained about something else.

Now after fixing a bug in my code, the problem is gone, and it doesn't hang anymore...

So sadly, I have no idea where it got caught or why... but this sort of thing does seem to happen quite a bit :/

@rainers
Copy link
Member

rainers commented Aug 28, 2024

Running the dmd frontend on code that is just being edited can cause it to go into some bad loops like recursive template instantiations that it might not recover from well. Maybe there are also new globals that are not cleared by the reinitialization that keep pointers to GC managed memory. I will have to check that...

There is an option to restart the semantic engine if a memory threshold is reached (Tools->Options->Text Editor->D->Intellisense->restart parsing engine), maybe it helps to keep the excessive memory usage in check. It doesn't restart the process, though, just wipes all cached analysis, so it might still suffer from (false) references into the GC.

@TurkeyMan
Copy link
Author

Hmm, well between each episode I had to kill Visual Studio and restart the whole thing; it wasn't enough to kill the DMD server for VS to recover... I had to go nuclear every time. It was super weird, just this one scope if I hit a breakpoint it was over, even after crashes and restarts... and now it's just gone. I can't reproduce it anymore. I have no idea what changed.

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