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
Extreme memory leak #101
Comments
I originally titled this bug report "occasional extreme memory leak", but it's already happened 3 times in two hours today, which I don't think qualifies as occasional ;) As far as I can recall, every time it's occurred when I was reorganising code using cut & paste, moving blocks around... |
always this 'occassional' - I hate it, because it's not even a hint that it's reproducable :D, but anyway, I'd say that you might download the mono-d sources, build them on your own and "debug" them (meaning getting the root of all evil code), only if you want to do so. |
Hm, ok I got as far as having built Mono-D (without errors), and trying to debug it, but the "Start Debugging" (F5) option is greyed out. Any ideas? Still haven't worked out any pattern to this bug, but it's happening very often, like a few times an hour. |
I'm developing Mono-D on windows - so with VS instead of MD - I also have to copy all output files to the addins directory first (I created a .bat for me). You probably should debug the customly-built MonoDevelop.exe instead, so if it throws or hangs, you can set a breakpoint somewhere in Mono-D's code - anyway, haven't figured out yet how to do it on Linux :/ |
Ok, I've made a bit of progress here. I've managed to find a situation where the error occurs fairly reliably, and reduce it to a simple single-module case.
The error occurs when typing
after the line It doesn't always happen, and doesn't always happen at exactly the same point during typing the above lines, but seems to occur about 50% of the time in this situation. Hopefully this might give you a hint as to what might be causing this... I'm very interested to see if you can reproduce the problem with these instructions! (I've not looked any further into running MD in the debugger, btw.) |
Well, yay I was able to reproduce the error - thank you very much for that! :D |
I'm glad it's not just me then! :) |
This bug results of temporarily unfinished code - it doesn't know how to continue if there's only a |
Ah that makes sense... It always seems to happen when I'm either writing completely new code (like in that example) or refactoring code, moving chunks around with cut & paste. |
Ok, fixed it - just reinstall and pray that it's working from now on :), if it's still not working, meh :/ [Edit] There has been even an other issue with "unfinished" code - but this should be solved now. |
Great news! One question: Any idea how to set where MonoDevelop gets its addin updates from? I've compiled MD from source (version 3.1) and when I try to update the addins it says: "Could not get information from repository: http://addins.monodevelop.com/Beta/Linux/3.1.0/main.mrep." I've had a look in the preferences, but can't find anything to determine where it looks for addin updates... |
You can enter even the beta channel url manually in the addins repo manager - just replace the 3.1.0 with 3.0.0 - because the one MD developer probably forgot to setup this directory online^^ |
Oh no :( I changed the repositories as suggested, uninstalled the addin, and now I can't reinstall it! It doesn't appear in the list of language bindings any more. I'm Mono-D-less :( |
Then just add the mono-d.alexanderbothe.com repository - it's also probably a further release issue.... really awful handling of addins - that's probably why there are so few ones available online^^ |
Ok cool that worked, thanks. Version 0.3.9.5. So the good news: the test case I described above now seems to be ok. I'll continue observation and let you know if it happens / doesn't happen again in other circumstances :) The bad news: now MonoDevelop is constantly around 180% CPU usage when I open a large project. (This didn't happen before I updated to Version 0.3.9.5.) Possibly related to bug #96? |
gahh ok, so now define "large project" please - it's probably another "while(true)" something, but this happens in very few situations then..^^ |
Well, for a start tango, which contains about 200K lines of code. Plus our own stuff which is also pretty big. Is there anything I could try to see what might be triggering this? |
You probably could check if it's tango - or your project. By opening an other (or creating an empty) project. The main problem is that it's parsing all sources initially because it has to do so. Is MD just computing something or is it massively allocating memory? |
No it's just CPU usage, no out of control memory allocation any more. |
I'd be really happy if you could debug or at least halt the process to see where it loops.. Hmm, do you have a windows pc somewhere with VS installed? Then you could check it :D |
Unfortunately not... Looking at the MonoDevelop process with Connecting to the process in gdb yields the following information about the threads:
Not sure if any of that helps at all! Let me know if you'd like me to look into any thread in particular to try and get a backtrace or anything... |
All I could do now is to provide an extra version to check - yeah I guess this will do it - so all I do then is to let Mono-D note the last parsed document in a log file - to check in what document it's hanging.. how long will you be online today? |
Ok sounds cool! I'll be around for another 90 mins or so today, then back tomorrow :) |
So, I just added a 'hook' to the directory parser that hopefully will show you where it hangs.. You can download the package from http://mono-d.alexanderbothe.com/MonoDevelop.D_0.3.9.5_debug.mpack and install it directly, without any addins channel or whatever. To make the results as transparent as possible, I recommend you to temporarily remove all includes - to exclusively focus on your project files. I made the entire directory analysis procedure single-threaded - so it should be easier to follow what it's parsing currently :) Anyway, by checking out the files that are parsed at latest, I really hope that we can find these error-causing language constructs :D |
Ok initial test results... The problem is actually caused by me including (in Options > Compiling > Includes) libraries by their root directory, rather than the subdirectory which contains the actual library code. So, for example, the tango root dir contains the following subdirs: build, doc, tango. The latter is where the actual source code lives, but I was giving the root dir in the include path ( If I change the include to The weird thing is that this was never happening before version 0.3.9.5. I'll have a look to see if I can narrow it down to which module is causing the problem when I include the root dirs. |
I notice it's not actually a valid D module, as it's lacking a module declaration. Interesting... Thanks for the special debug version of the addin! |
Ok now I've found something interesting... I'm now testing with a workspace which contains several solutions, one of which is tango. All the other solutions reference tango, and have I'm not sure if it should be parsing files which aren't included in a project... seems weird, or? So I guess there are kind of two issues here. |
First off all: Great that you've been able to find out some hints where the parser is at its limit! :D, Are you using tango D2 or D1? I guess doc/dil/data only exists in the first version? Then it could be a problem - I've also noticed some problems with T1 some time ago - anyway, Tango for D2 is being parsed flawlessly though.^^ |
Yeah it's tango D1. I just noticed that while changing the includes from |
It's probably because it's not finding a module package called "tango" anymore - it's directly "math.BigInt" instead "tango.math.BigInt" now. |
Ah true, that's probably why :) |
So it's mainly a problem related to tango.. but anyway I guess it'd be better to estimate if a file contains generically invalid data - like it's already skipping 'phobos.d' or 'index.d' in which only html-like stuff is written |
:D Just tried to open text.UnicodeData ... 0.1M Lines to parse -- who the hell wrote this!? |
Haha, ah that classic module ;) |
I'd say this is a fix... I've not had this problem at all since the update, and it was happening very regularly before. |
Sorry to report this after bug #65 finally being fixed, but something similar (indeed worse) has started happening now :(
The IDE hangs, with high CPU usage. Looking at top, MonoDevelop is actually continually allocating memory -- which accounts for the high CPU usage I suppose! Within a second or two the process has allocated > 80% of my total RAM, and keeps growing. Obviously at this point the whole system grinds to a halt.
This has happened to me twice now since upgrading to version 0.3.9, and both times in different situations. In fact it happened so suddenly that I can't really remember exactly what I had just done which triggered it. I'll try to work out if there's some pattern to it, if it happens again.
The text was updated successfully, but these errors were encountered: