-
Notifications
You must be signed in to change notification settings - Fork 54
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
Unintended heap allocations #91
Comments
Seems to be eigen stuff. It has the nice With https://gitlab.com/libeigen/eigen/-/merge_requests/1055 it even supports reallocs. |
It is definitely Eigen, as the lowest node of the call graph above already reveals. This means, that Eigen is used wrong or has some unknown version incompatibility with ProxQP. |
Then you can try to surround the solve() call with
NOTE: Don't forget to compile in |
@fennel-labs Thanks for raising this issue. |
I tried with 3.4.0, allocations still happen. Here is the corresponding call graph: @fabinsch You can find all relevant function names with allocations in the figure. |
@fennel-labs We have fixed the heap allocations in the code in #92. |
@jcarpent I can confirm, that this fixes the issue under Eigen 3.4.0. With 3.3.4 heap allocations are still observed. |
Could provide the call graph for 3.3.4 after the fix? |
@fennel-labs I've just updated the PR with further fixes. Should be fine hopefully. |
@jcarpent Some allocations are still left: |
@fennel-labs 2ec747d should fix the issue on Eigen 3.3.4 |
@jcarpent Yes, allocations are gone now for both, 3.3.4 and 3.4.0. Thank you so much! |
Thanks @fennel-labs for the quick feedback. We really appreciate it. |
ProxQP does a lot of work to avoid heap allocations. However, I found that some heap allocations are still performed after the initialization. Here is the call graph with the functions that allocate from the heap during solve():
Steps to reproduce:
-O0 -g -DNDEBUG -std=gnu++17 -DPROXSUITE_VECTORIZE
valgrind --tool=massif --xtree-memory=full <name_to_executable_to_examine>
kcachegrind <name_of_output>
Desired behavior
ProxQP does not generate any heap allocations during solve. This is essential for running ProxQP on resource-constrained devices or under real-time constraints.
The text was updated successfully, but these errors were encountered: