Open AditMeh opened 8 months ago
No, if the program is using that much memory, that means memory is being allocated but never freed.
Can you verify you are working with std::shared_ptr
?
Yes, and I'm pretty much never allocating any new memory except for when actually making the tree. By the time it reaches the code to launch the libgl viewer screen it should have freed everything it doesn't need.
I checked the memory usage and reached near the maximum of my computer's memory before crashing. The code works for other combinations of objects though (though it also uses a lot of my computer memory). This combination specifically (../data/knight.obj and ../data/cheburashka.obj) seems to be way too costly for my machine to render.
This combination specifically (../data/knight.obj and ../data/cheburashka.obj) seems to be way too costly for my machine to render.
In my implementation, intersections of those two objects don't use more than 100 MB of memory. Since intersections check is also queue-based, I would check anything involving recursion (e.g. AABB construction).
How many leaf pairs does your solution get for these two models? Mine is getting 53336000. I suspect it is too high an amount which is why it crashes
How many leaf pairs does your solution get for these two models?
Less than 1500 pairs.
Then that's probably it. Both my brute force triangle-triangle intersection and AABB intersection algorithms return the same amount of pairs, but both algorithms must be incorrect in some way.
Thanks for the help
My code probably has a long runtime because I haven't gotten around to optimizing it, but my intersect algorithm has the same complexity as the one given in the README. However, the process gets killed (probably because it takes up too much memory). Does this mean I'm detecting too many leaf pairs? My AABB method seems to align with the brute force, so I'm confused.