Skip to content

Instantly share code, notes, and snippets.

@sclarson
Created June 3, 2015 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sclarson/8ddff50042d5894fbb31 to your computer and use it in GitHub Desktop.
Save sclarson/8ddff50042d5894fbb31 to your computer and use it in GitHub Desktop.
Unserialize link
phinas@trogdor$ php unserialize-link-maybe.php 20
Attach 8 MB shared memory segment
Memory after my_array creation: 524288 -> 25427968 (+24903680 +23.75 MB, initial +24903680 +23.75 MB)
Memory used by serialized my_array 1st element: 335 B, used by serialized my_array: 3.26 MB, 10000 elements
Memory after unset#001: 26214400 -> 26738688 ( +524288 +512 kB, initial +524288 +512 kB)
Memory after unset#003: 26738688 -> 27000832 ( +262144 +256 kB, initial +786432 +768 kB)
Memory after unset#004: 27000832 -> 26738688 ( -262144 -256 kB, initial +524288 +512 kB)
Memory after unset#005: 26738688 -> 27000832 ( +262144 +256 kB, initial +786432 +768 kB)
Memory after unset#006: 27000832 -> 27787264 ( +786432 +768 kB, initial +1572864 +1.5 MB)
Memory after unset#007: 27787264 -> 28573696 ( +786432 +768 kB, initial +2359296 +2.25 MB)
Memory after unset#008: 28573696 -> 29097984 ( +524288 +512 kB, initial +2883584 +2.75 MB)
Memory after unset#009: 29097984 -> 29884416 ( +786432 +768 kB, initial +3670016 +3.5 MB)
Memory after unset#010: 29884416 -> 30670848 ( +786432 +768 kB, initial +4456448 +4.25 MB)
Memory after unset#011: 30670848 -> 31457280 ( +786432 +768 kB, initial +5242880 +5 MB)
Memory after unset#013: 31457280 -> 31719424 ( +262144 +256 kB, initial +5505024 +5.25 MB)
Memory after unset#015: 31719424 -> 32243712 ( +524288 +512 kB, initial +6029312 +5.75 MB)
Memory after unset#017: 32243712 -> 32768000 ( +524288 +512 kB, initial +6553600 +6.25 MB)
Memory after unset#018: 32768000 -> 33030144 ( +262144 +256 kB, initial +6815744 +6.5 MB)
Memory after unset#019: 33030144 -> 33292288 ( +262144 +256 kB, initial +7077888 +6.75 MB)
Memory after unset#020: 33292288 -> 33554432 ( +262144 +256 kB, initial +7340032 +7 MB)
Memory after shm_remove: 33554432 -> 33292288 ( -262144 -256 kB, initial +7077888 +6.75 MB)
Defined variables: argc, argv, num_loops, shm_size, shm_key, shm_id, initial_memory_usage, prev_memory_usage, memory_usage, loop, k, i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment