Memory Spikes in Armijo Line-Search Algorithm
Closed this issue · 2 comments
I'm running a simulation using PolyFEM, and after some time steps, the OS kills the process with an error message: 'Out of memory.'
I monitored the memory consumption and found that it remains stable, but suddenly it spikes in some time steps. Once it spikes, it stays at the same level until I call the build_basis()
method in PolyFEM, at which point it releases the memory.
When I switch the line-search algorithm to Backtracking, the issue does not occur. It only happens when I use the Armijo or RobustArmijo algorithms.
I am unable to debug the code because the issue arises only in later time steps, and in the debug version, the code runs much slower. What could be causing the memory spike? Is there a potential workaround?
It could be that the SpatialHash data structure becomes very large if the update direction is very large. You can try switching to an alternative method. For example:
{
"solver": {
"contact": {
"CCD": {
"broad_phase": "sweep_and_prune"
}
}
}
}
Using that method I didn't get the memory spike again!
Thanks