-
Notifications
You must be signed in to change notification settings - Fork 299
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
OutOfMemoryError in cycle check #214
Comments
The cycle detection can unfortunately start to use up a big amount of heap simply for the violations, I've noticed that, too. I've used it once in a big project and had to introduce a really ugly hack to cut off all details after the first line. The problem is AFAIK, that ArchUnit lists all dependencies of every edge of every cycle found.
I.e. group your classes by the top-level package under |
Thanks at lot! That additional test helped me to track down some dependency cycle in my tests. As for this test and all the others I'd really appreciate a more concise output. Not only for cycle checks but in general. Something like that:
So:
|
Hmm, I see your point, I know the output is very verbose. Unfortunately I think this would be a very big thing to implement at the source, i.e. where the error messages are created. Also in parts you don't have all the information there, you first need all violations to e.g. group them. On the other hand violations have a very generic form at the moment, since ArchUnit is so powerful that it is hard to force a common message format on all the use cases. E.g. at the moment I can add my own condition to do
And there is really not much structure within that message 😉
Then maybe configure in
The only bad thing is, that there is nothing available as input except a rough distinction between rule text and failure detail lines. |
I'm using ArchUnit in three systems now. Two smaller systems (around 5kLOC) and a larger one (125kLOC, 1000 classes, 100 packages). In every system there is a cycle check:
In the smaller systems this check is fast (around 200ms) and works perfectly fine. But in the larger system the test crashes after a minute throwing an OutOfMemoryError while using up more than 3GB of RAM.
Checking for cycles in sub-packages works fine, though:
for each of the four layers. This is my current workaround: for each layer I have a separate cycle test and a
layeredArchitecture()
ensures that there are no cycles between layers.After examining the stack trace I guess that my workaround is leaky and there is some weird large cycle that produces a violation description output of several GB -- maybe because there is some unnoticed infinite recursion in some description generation. But that guess might also be completely off. I don't know and I don't know enough about the inner workings of ArchUnit, yet.
The text was updated successfully, but these errors were encountered: