def METHOD_NAME(self):
    mgr = cuda.current_context().memory_manager
    # Allocate an array and check that memalloc was called with the correct
    # size.
    arr_1 = np.arange(10)
    d_arr_1 = cuda.device_array_like(arr_1)
    self.assertTrue(mgr.memalloc_called)
    self.assertEqual(mgr.count, 1)
    self.assertEqual(mgr.allocations[1], arr_1.nbytes)
    # Allocate again, with a different size, and check that it is also
    # correct.
    arr_2 = np.arange(5)
    d_arr_2 = cuda.device_array_like(arr_2)
    self.assertEqual(mgr.count, 2)
    self.assertEqual(mgr.allocations[2], arr_2.nbytes)
    # Remove the first array, and check that our finalizer was called for
    # the first array only.
    del d_arr_1
    self.assertNotIn(1, mgr.allocations)
    self.assertIn(2, mgr.allocations)
    # Remove the second array and check that its finalizer was also
    # called.
    del d_arr_2
    self.assertNotIn(2, mgr.allocations)