memory-profiler 1.1.14 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/ext/memory/profiler/capture.c +5 -15
- data/lib/memory/profiler/version.rb +1 -1
- data/readme.md +4 -4
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cce184966c5eb2b104059f419fb7f220b2bea168b5359adacc90923079332241
|
|
4
|
+
data.tar.gz: 436690f9e75f5ba72546604fd58d71efccb56d4dc8b8880feaa3b4ecab03c918
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 54d4d1e2f8d19da788e53ffa0c5e69dcaf5db708d5d1de0336bccc79c6311330a56b0c8cb605b7bb7dbc116b91b91a752cacf317d4403e5188517ddcdded12a2
|
|
7
|
+
data.tar.gz: 4994f81f0b6dd2b0c46bc3aa3e415dbc16ffb633d9fefdeafd67d10df522aaccc5003dd632a664b8eb69e476053bac5f51d0979c69c4daa97965356b1bb2ca9c
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -298,21 +298,6 @@ static void Memory_Profiler_Capture_event_callback(VALUE data, void *ptr) {
|
|
|
298
298
|
VALUE klass = rb_class_of(object);
|
|
299
299
|
if (!klass) return;
|
|
300
300
|
|
|
301
|
-
// Check if class is already freed (T_NONE). This can happen when:
|
|
302
|
-
// 1. Object was allocated before capture started (no NEWOBJ event queued).
|
|
303
|
-
// 2. Anonymous class (Class.new) was freed before its instances.
|
|
304
|
-
//
|
|
305
|
-
// If the class is T_NONE, it means:
|
|
306
|
-
// - It's NOT in tracked_classes (would retain it via GC mark callback).
|
|
307
|
-
// - It's NOT in any pending NEWOBJ event (would retain it via event queue marking).
|
|
308
|
-
//
|
|
309
|
-
// Therefore process_freeobj() would skip this event anyway (class lookup fails at line 200).
|
|
310
|
-
// We must skip enqueueing to avoid attempting to mark a T_NONE object during GC,
|
|
311
|
-
// which can cause: [BUG] try to mark T_NONE object.
|
|
312
|
-
if (rb_type(klass) == T_NONE) {
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
301
|
if (DEBUG) {
|
|
317
302
|
const char *klass_name = "(ignored)";
|
|
318
303
|
if (event_flag == RUBY_INTERNAL_EVENT_NEWOBJ) {
|
|
@@ -325,6 +310,7 @@ static void Memory_Profiler_Capture_event_callback(VALUE data, void *ptr) {
|
|
|
325
310
|
// Skip NEWOBJ if disabled (during callback) to prevent infinite recursion
|
|
326
311
|
if (capture->paused) return;
|
|
327
312
|
|
|
313
|
+
// Check if class is already freed (T_NONE). This can happen when:
|
|
328
314
|
// It's safe to unconditionally call here:
|
|
329
315
|
object = rb_obj_id(object);
|
|
330
316
|
|
|
@@ -332,6 +318,10 @@ static void Memory_Profiler_Capture_event_callback(VALUE data, void *ptr) {
|
|
|
332
318
|
} else if (event_flag == RUBY_INTERNAL_EVENT_FREEOBJ) {
|
|
333
319
|
// We only care about objects that have been seen before (i.e. have an object ID):
|
|
334
320
|
if (RB_FL_TEST(object, FL_SEEN_OBJ_ID)) {
|
|
321
|
+
// For freeobj, we only care about klasses that we are tracking.
|
|
322
|
+
// This prevents us from enqueuing klass objects that might be freed.
|
|
323
|
+
if (!st_lookup(capture->tracked_classes, (st_data_t)klass, NULL)) return;
|
|
324
|
+
|
|
335
325
|
// It's only safe to call here if the object already has an object ID.
|
|
336
326
|
object = rb_obj_id(object);
|
|
337
327
|
|
data/readme.md
CHANGED
|
@@ -22,6 +22,10 @@ Please see the [project documentation](https://socketry.github.io/memory-profile
|
|
|
22
22
|
|
|
23
23
|
Please see the [project releases](https://socketry.github.io/memory-profiler/releases/index) for all releases.
|
|
24
24
|
|
|
25
|
+
### v1.1.15
|
|
26
|
+
|
|
27
|
+
- Ignore `freeobj` for classes that are not being tracked.
|
|
28
|
+
|
|
25
29
|
### v1.1.14
|
|
26
30
|
|
|
27
31
|
- Ignore `freeobj` events for objects with anonymous classes that are not tracked (and thus become `T_NONE`).
|
|
@@ -66,10 +70,6 @@ Please see the [project releases](https://socketry.github.io/memory-profiler/rel
|
|
|
66
70
|
- Better state handling and object increment/decrement counting.
|
|
67
71
|
- Better call tree handling - including support for `prune!`.
|
|
68
72
|
|
|
69
|
-
### v1.1.5
|
|
70
|
-
|
|
71
|
-
- Use queue for `newobj` too to avoid invoking user code during object allocation.
|
|
72
|
-
|
|
73
73
|
## Contributing
|
|
74
74
|
|
|
75
75
|
We welcome contributions to this project.
|
data/releases.md
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|