-
Notifications
You must be signed in to change notification settings - Fork 148
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
Why are SArrays extremely memory inefficient? #876
Comments
From the ReadMe.md |
Yes. Basically most functions in StaticArrays are generated dynamically (via The compiler not only temporarily uses these expressions while compiling but caches much of it. So the first time you call For each instance of that type that you keep, you'll store an additional While the documentation mentions arrays up to 100 elements I tend to recommend it for e.g. geometry with 3-vectors and rotation matrices, and similar. |
Ok. That's sad, but Thank you. |
Hello,
This should allocate 8 MB,
but it prints
I did some smaller allocations, checked the output of htop and found that
zeros(SArray{Tuple{128,N},Float64})
needs wayyyy more memory than the N kB expected.The text was updated successfully, but these errors were encountered: