-
Notifications
You must be signed in to change notification settings - Fork 5
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
byte size for ets record? #1
Comments
Part of the difference could be sharing the term so that a size is only counted once (i.e., not a flat size), but the main difference should be how the shell reports the wrong size for binaries. It is better if you test this in a compiled module. Either way, due to terms being used in ways where the size only counts once, it is possible the exact size value may differ slightly. The erlang_term module is giving the upper limit on the memory for storing the term (when not used in the shell, since the shell does not report the correct sizes). So, the erlang_term module can help you manage caching, but the real situation in the Erlang VM with the many memory pools is more complex. |
Thanks very much for reply.
Yes, I tested this in a compiled module :
the result is :
As you can see, the shell reported wrong sizes, but the difference is remains. Thanks very much again ! |
No problem. |
Hi,
I am developing a cache via ets, one feature is single record memory usage limit. That is , if a record inserted into ets table need too large memory, I will delete it . Conversely , retain it .
operation process :
But, I think this method is not smart. So, I finding another way, get the single record memory usage without insert ets table. I found your repo through
erts_debug:flat_size/1
from Erlang-MailList.Soon, I got a question, let me show you my test code:
Indeed, I got two different result via above test code. I can not understand why. Would you help me please ? Thanks very much.
The text was updated successfully, but these errors were encountered: