Skip to content
  • Peter Zhu's avatar
    f0d08d11
    Fix memory leak when copying ST tables · f0d08d11
    Peter Zhu authored
    st_copy allocates a st_table, which is not needed for hashes since it is
    allocated by VWA and embedded, so this causes a memory leak.
    
    The following script demonstrates the issue:
    
    ```ruby
    20.times do
      100_000.times do
        {a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9}
      end
    
      puts `ps -o rss= -p #{$$}`
    end
    ```
    f0d08d11
    Fix memory leak when copying ST tables
    Peter Zhu authored
    st_copy allocates a st_table, which is not needed for hashes since it is
    allocated by VWA and embedded, so this causes a memory leak.
    
    The following script demonstrates the issue:
    
    ```ruby
    20.times do
      100_000.times do
        {a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9}
      end
    
      puts `ps -o rss= -p #{$$}`
    end
    ```
Loading