[erlang-questions] Erlang "system_limit" trouble!

zabrane Mikael zabrane3@REDACTED
Mon May 31 14:54:02 CEST 2010


I found the bug (thanks to erlang:port_info/1).

===== PortInfo: [{name,"zlib_drv"},
                 {links,[<0.2.0>]},
                 {id,2020},
                 {connected,<0.2.0>},
                 {input,0},
                 {output,26401}]
===== PortInfo: [{name,"zlib_drv"},
                 {links,[<0.2.0>]},
                 {id,2021},
                 {connected,<0.2.0>},
                 {input,0},
                 {output,585}]
....

The problem was with my wrong usage of "zlib" module.
The only place i've use it, is here in this function which
try to "uncompress" a GZIP compresses data:

uncompress_if_gzip(Bin0) ->
    try zlib:gunzip(Bin0) of
              Bin1 ->
                  Bin1
          catch
              _:_ -> % NOT GZIP compressed
                  Bin0
    end,


Could someone please clarify how to correctly "TRY to uncompress" a binary
with "zlib" module?

Thousands thanks "Gleb" ... you saved my day !



2010/5/31 zabrane Mikael <zabrane3@REDACTED>

> You're right about your assumption!!!
>
> erlang:ports(). -> grows infinitely
> erlang:processes(). -> are stable (always the same = 69)
> erlang:memory(). -> memory is increasing
>
> So the bug seems to be in another place.
> How can I be sure that my calls to "port_close" effectively closed
> the ports?
>
>
> 2010/5/31 Gleb Peregud <gleber.p@REDACTED>
>
>> Does these show anything weird?
>>
>> erlang:ports().
>>
>> erlang:processes().
>>
>> erlang:memory().
>>
>> On Mon, May 31, 2010 at 13:29, zabrane Mikael <zabrane3@REDACTED> wrote:
>> > 2010/5/31 Gleb Peregud <gleber.p@REDACTED>
>> >>
>> >> Try using "lsof" with the process ID of the beam to see if these files
>> >> are really closed properly
>> >>
>> >
>> > $ lsof -c beam.smp
>> > doesn't seem to report anything strange (I also tried with beam's PID
>> "lsof
>> > -p 17588").
>> > I forget to mention that my code in single threaded, and I only use one
>> > process at a time.
>>
>
>
>
> --
> Regards
> Zabrane
>



-- 
Regards
Zabrane


More information about the erlang-questions mailing list