[erlang-bugs] Dialyzer PLT update takes too much memory
Wed Jan 30 17:45:40 CET 2013
On 01/30/2013 05:53 PM, Kostis Sagonas wrote:
> On 01/30/2013 05:33 PM, Loïc Hoguin wrote:
>> Going from R15B03 to R16A and trying to dialyze has Dialyzer complains
>> about the outdated PLT. So far so good. Problem is Dialyzer never
>> manages to update said PLT due to an excessive amount of memory use.
>> With 2GB of free memory the following command fails when the PLT is
>> dialyzer --src src --plt .cowboy.plt --no_native -Werror_handling
>> -Wrace_conditions -Wunmatched_returns
>> The following output is observed:
>> Checking whether the PLT .cowboy.plt is up-to-date... no
>> (the PLT .cowboy.plt was built with an old version of Dialyzer)
>> Rebuilding the information in .cowboy.plt...
>> Crash dump was written to: erl_crash.dump
>> eheap_alloc: Cannot allocate 762886488 bytes of memory (of type "heap").
>> make: *** [dialyze] Aborted (core dumped)
>> The crash dump is a mighty 102MB.
>> Building the PLT from scratch works.
> You cannot expect the update to work. In R16* there have been major
> changes related to where the type information of BIFs is located: before
> most of it was hardcoded in erl_bif_types while now it appears in the
> corresponding files (e.g. erlang.erl). I am not sure whether this is the
> culprit or not, but I can understand that changes like this one cause
> serious confusion.
> I suggest that you always build the PLT from scratch in each new version
> which, as you mention, works.
I'm fine with it, but then the message
(the PLT .cowboy.plt was built with an old version of Dialyzer)
should probably be replaced by a suggestion to build the PLT from
scratch; as it is Dialyzer makes it sound like it can take care of it
without problem. Thing is, if it eats all the memory, under Linux the
kernel might decide to kill another application to allocate the space,
which requires at the very least a fair warning.
More information about the erlang-bugs