[erlang-questions] halfword emulator state

Sverker Eriksson sverker@REDACTED
Tue May 31 15:05:23 CEST 2011


Paolo Negri wrote:
> [...]
> - [2] states: "Much more of internal memory structures have been made
> able to use "high" memory and are no longer restricted to the 4Gb
> limit that still applies for all process heap data."
>   Is there any documentation explaining exactly which structures can
> use the high memory and what instead is constrained to the "low"
> memory? Where would the content of the constant pool reside?
>
>   
Beam code and Erlang terms are stored in low memory.
Except:
* ETS table data
* Large binaries (>64 bytes)
* NIF resources

> - How could the containment of structures restricted to the "low"
> memory be measured? How would someone monitor the memory usage of the
> VM being able to prevent out of memory errors without restricting the
> whole VM to use over 4Gb?
>
>   
In halfword emulator from R14B03
* erlang:memory() shows a 'low' value counting all allocated low memory.
* erlang:system_info(allocator) shows a boolean value 'low' to indicate 
if an allocator is using low memory or not.

> - What are the caveats - if any - for using nifs when using the
> halfword emulator? Which aspects of the nifs should be tested in order
> to consider safe to run them with the halfword emulator?
>
>   
It should be tested on a halfword emulator. A NIF library compiled 
towards a regular 64-bit vm will fail to load on a halfword vm and vice 
versa.
Don't break the API by assuming anything about the opaque types, such as 
ERL_NIF_TERM.


/Sverker, Erlang/OTP Ericsson





More information about the erlang-questions mailing list