-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
WIP: Total size of Julia objects #7603
Comments
see also #3393 |
The obvious pitfalls here are shared structure and cycles. If |
Just as for |
The high-level use case is answering the question "where is all my memory going?" This is a completely common practical question when working with large amounts of data interactively. You look at it and see that some matrix you don't really need any more is taking a large chunk of memory that you need, so you clear it. In our case, you assign an empty matrix to it and call gc. If multiple variables reference the same chunk of memory, then you'd want to know that so that you can decide if you want to "clear" all of them to free up that memory or not. |
Thanks for the comments, I have updated the gist adding a check on pointers. Now if |
For that use-case, it would be good to report this in the |
@stevengj, I cannot fully understand how |
I would just store |
I have polished the code in the gist and added unit tests in this other gist https://gist.github.com/avitale/e8bd84f6293f595a3845 . If you don't have any more comments, I consider it completed. |
@avitale, it would be great if you could turn your two gists into a pull request against master. That's the usual way for this to get more traction and work out any other concerns. Just let us know if you need pointers on how to do a pull request. Thanks. |
@quinnj , I can try and do a pull request, could you give me some info on where should I put the files with source/test code, where should I write the docs and if there is anything else to do? Thanks |
Sure thing. You could probably put this in Docs can go in To make a pull request, you typically fork your own repo of julia, clone it locally, make your changes, add tests, then run |
Thanks @quinnj . Currently there are 2 "private" helper functions in the module that are not exported, when I put the code in |
It really depends. Sometimes the |
I would find quite useful a
Also smaller size tensor show the same behaviour although with this size the inconsistency is systematic, at least on my laptop
|
For folks who are still looking for this feature, we have
|
Hi, I couldn't find any function to calculate the total size of an object (ie including size of its elements), so I wrote one
https://gist.github.com/avitale/0070b629b89350b39c21#file-totalsize-jl
is there any interest in including it in base?
The text was updated successfully, but these errors were encountered: