-
Notifications
You must be signed in to change notification settings - Fork 4
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
bad_alloc exception (memory overflow?) #13
Comments
Hi, It's a known problem that the treemap keeps filling up. Deleted entries have its value mostly deleted, but the entry in the vector&map is not removed. This is because of an initial design decision from the original "Alpha" code where each symbol gets an entry in a vector and then keyed in a map. Removing entries in the vector would change all id's that follows the deleted id. I tried to replace it with something more flexible, but then new features popped up that the "new" design didn't cover, so I went along for now with this original design. However I don't think this is the source of the memory leak. It's just an entry in the vector+map that floats around with hardly any data in it and is cleared when the app is restarted. Maybe some memory-leak tracing tool like valgrind or DrMemory might help ? Yves |
i tried DrMemory, but it crashed, because of internal out of memory xD I noticed that this crash only happens if my code does not compile. If the code compiles all seems to be ok. Can it be that the plugin does not detect that the parser returned with an error and continued to launch parsers at infinitum? |
I don't think "launching" parsers can be a problem unless maybe they are continuously queued. There are only a couple of threads: The UI thread obviously which also serves as the controlling thread. Then there is a thread to perform code completion and most other operations and a thread with the single purpose to do the background indexing (which might become a threadpool in the future). Since a month or so I introduced another thread that is only used for parsing so that parsing is decoupled from code-completion using 2 instances of a translation-unit. This way the user still has code-completion while a file is re-parsed. If the crash happens when the code doesn't compile, I would rather look at the warning&errors subsystem. I use this plugin on a codebase of a couple of gigabytes worth of sources so the size of the project is probably also not an issue. I do notice memory usage can be pretty large on large files and&or big include trees. |
I work on the codeblock code (so quite large project) on Windows and after some time i get a crash with this back trace:
The ram usage of codeblocks at this moment is 1.079GByte (normally it is somewhere about 300MB)
in src/treemap.h:32
the size reported from m_Data.size() is 131072
i have no idea how to debug this error. I have also no idea if this is a memory leak or that the codebase is simply to large (but i don't think that this is the problem, because clang does not throw a badalloc )....
any hint would be appreciated
The text was updated successfully, but these errors were encountered: