[ARVADOS] created: 9045a0861e96a7c9f2717e9c5c34760cb3a30f66
git at public.curoverse.com
git at public.curoverse.com
Wed Nov 25 16:42:08 EST 2015
at 9045a0861e96a7c9f2717e9c5c34760cb3a30f66 (commit)
commit 9045a0861e96a7c9f2717e9c5c34760cb3a30f66
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Wed Nov 25 16:41:45 2015 -0500
7832: Add __slots__ and remove __del__ which interfers with garbage collection. Memory usage comes down by ~40%
diff --git a/sdk/python/arvados/_ranges.py b/sdk/python/arvados/_ranges.py
index 83437b2..8387416 100644
--- a/sdk/python/arvados/_ranges.py
+++ b/sdk/python/arvados/_ranges.py
@@ -6,6 +6,8 @@ _logger = logging.getLogger('arvados.ranges')
RANGES_SPAM = 9
class Range(object):
+ __slots__ = ("locator", "range_start", "range_size", "segment_offset")
+
def __init__(self, locator, range_start, range_size, segment_offset=0):
self.locator = locator
self.range_start = range_start
@@ -53,6 +55,8 @@ def first_block(data_locators, range_start):
return i
class LocatorAndRange(object):
+ __slots__ = ("locator", "block_size", "segment_offset", "segment_size")
+
def __init__(self, locator, block_size, segment_offset, segment_size):
self.locator = locator
self.block_size = block_size
diff --git a/sdk/python/arvados/arvfile.py b/sdk/python/arvados/arvfile.py
index 0326608..71af644 100644
--- a/sdk/python/arvados/arvfile.py
+++ b/sdk/python/arvados/arvfile.py
@@ -543,9 +543,6 @@ class _BlockManager(object):
def __exit__(self, exc_type, exc_value, traceback):
self.stop_threads()
- def __del__(self):
- self.stop_threads()
-
def commit_bufferblock(self, block, sync):
"""Initiate a background upload of a bufferblock.
diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index 1822af1..c584f04 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -148,6 +148,8 @@ class KeepBlockCache(object):
self._cache_lock = threading.Lock()
class CacheSlot(object):
+ __slots__ = ("locator", "ready", "content")
+
def __init__(self, locator):
self.locator = locator
self.ready = threading.Event()
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list