Skip to content

Instantly share code, notes, and snippets.

@mwtian
mwtian / gist:0f473325a1ad5a74982fcf91737653b4
Last active May 13, 2025 06:05
Debugging Sui node memory growth

Debugging Sui node memory growth

When there is memory usage growth in the sui-node process (validator or fullnode), usually this is hard to reproduce and not unobserved on many other instances (otherwise the issue would have been fixed before the release). More infromation are usually needed to help us debug the issue.

Metrics

First, a few metrics can be checked to see if a particular stream is very large and keeps growing.

  • rocksdb_estimate_table_readers_mem
  • rocksdb_block_cache_usage
@mwtian
mwtian / object_ref_shuffle.py
Last active August 29, 2021 06:35
Shuffling object ref with actor
import datetime
import random
import time
import ray
from ray import ray_constants
from ray import cloudpickle
from collections import defaultdict
ray.init(address="auto")
@mwtian
mwtian / profile.svg
Last active August 23, 2021 19:47
Ray getting objects with embedded refs CPU profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwtian
mwtian / refcount.py
Created August 15, 2021 19:02
Slow getting / deallocating nested object refs
import datetime
import time
import ray
from ray import ray_constants
from ray import cloudpickle
OBJ_REFS = 500 # number of put_object tasks to run, and number of top-level object refs input to ray.get()
EMBEDDED_OBJ_REFS = 2400 # number of embedded object refs per input object
REF_HIDING = False # whether to hide embedded object refs via cloudpickle.dumps(ray.put(input_object)))