docstr: ...Test brute force method in order to see if we have a memory leak
  during typemap out
docstr_tok: ["...","Test","brute","force","method","in","order","to","see","if","we","have","a","memory","leak","during","typemap","out"]
code: def test_sarray2d_memory_leaks(self):
      """...Test brute force method in order to see if we have a memory leak
      during typemap out
      """
      import os
  
      try:
          import psutil
      except ImportError:
          print(
              "Without psutils we cannot ensure we have no memory leaks"
          )
          return
  
      def get_memory_used():
          """Returns memory used by current process"""
          process = psutil.Process(os.getpid())
          return process.memory_info()[0]
  
      initial_memory = get_memory_used()
  
      n_rows = int(1e2)
      n_cols = int(1e3)
      # The size in memory of an array of ``size`` doubles
      bytes_size = n_rows * n_cols * 8
      a = test.test_typemap_out_SArrayDouble2dPtr(n_rows, n_cols)
      first_filled_memory = get_memory_used()
  
      # Check that new memory is of the correct order (10%)
      self.assertAlmostEqual(
          first_filled_memory - initial_memory,
          bytes_size,
          delta=1.1 * bytes_size,
      )
  
      for _ in range(10):
          del a
          a = test.test_typemap_out_SArrayDouble2dPtr(n_rows, n_cols)
          filled_memory = get_memory_used()
          # Check memory is not increasing
          self.assertAlmostEqual(
              first_filled_memory - initial_memory,
              filled_memory - initial_memory,
              delta=1.1 * bytes_size,
          )
  
imports: import gc
  import unittest
  import weakref
  import numpy
  import scipy
  from scipy.sparse import csr_matrix
  from tick.array.build.array import tick_double_sparse2d_from_file
  from tick.array.build.array import tick_double_sparse2d_to_file
  from tick.array_test.build import array_test
label_desc: Use image node_id 7 for calling the Test obj's underlying member method code with example usage: obj.test_sarray2d_memory_leaks() and returns: process