[erlang-questions] Using ETS for large amounts of data?

jay <>
Tue Sep 7 21:44:51 CEST 2010


Yes, I was thinking of erlang:split_binary/2.  I haven't used the new
binary module yet.

> On Tue, Sep 7, 2010 at 12:59 AM, <> wrote:
>
>>
>> Ryan also noted excess memory usage with binary:split:
>>
>> I believe binary pattern matching is now preferred over split.  If you
>> do
>> create sub-binaries but do not want all of them, remember that none of
>> the
>> memory occupied by the underlying large binary can be reclaimed as long
>> as
>> the sub-binaries reference it.  If you filter the sub-binary list, you
>> should make a new binary copy for each of the retained sub-binaries to
>> allow the old large binary to be recycled.
>>
>>
> AFAIK, the binary module was introduced in R14A.  In fact, I upgraded to
> R14A just so I could make use of the binary pattern matching in this
> module.
>  What I do with binary:split would take much more code with binary
> matching
> (I think).  Maybe you were thinking of erlang:split_binary/2?
>
> Anyways, I digress.  I don't want to hijack the original thread.  I'll
> post
> a new thread later today.
>
> -Ryan
>




More information about the erlang-questions mailing list