snmpa_mib_data_tttn.erl hangs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

snmpa_mib_data_tttn.erl hangs

alttagil
Hi!

I was wondering why simple erlang program hangs and consumes a lot of memory when it starts agent with simpliest MIB file:


JSM-MIB DEFINITIONS ::= BEGIN
          IMPORTS
      OBJECT-TYPE    FROM RFC-1212
      experimental   FROM RFC1155-SMI
      ;
 
  jsm OBJECT IDENTIFIER ::= { experimental 17780513 }

  jsmName OBJECT-TYPE
              SYNTAX  OCTET STRING (SIZE (0..255))
              ACCESS  read-only
              STATUS  mandatory
              DESCRIPTION Â«Description»
              ::= { jsm 1 }
END


So I've found that in snmpa_mib_data_tttn.erl function integrate_indexes creates a huge list of undefined_nodes atoms before it could insert MIB data at 17780513 position!


integrate_indexes(CurIndex, [{CurIndex, Data} | T]) ->
    [Data | integrate_indexes(CurIndex + 1, T)];
integrate_indexes(_Index, []) ->
    [];
integrate_indexes(CurIndex, L) ->
    [undefined_node | integrate_indexes(CurIndex + 1, L)].


Why not use maps for the purpose of indexing and just skip unset positions?


Alexander Hudich
@alttagil 


_______________________________________________
erlang-bugs mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-bugs