Skip to content

Commit 83a974f

Browse files
nateberkopecbenoittgt
authored andcommitted
Update README.md
1 parent e1bba26 commit 83a974f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Here is a list of questions I have. Feel free to make a PR to answer them.
1212

1313
* Retained Vs Allocated: Does an object that is allocated can turn to be retained because he is still present after few GC ?
1414

15+
Yes. The term "allocated" vs "retained" may vary depending on the tool you use, but, for example, in `memory_profiler`, "retained" means "survived a major GC".
16+
1517
* **[Answered]** What are the first line of a heap dump that are not address ?
1618

1719
Header of the heap dump [from heapy gem](https://github.com/schneems/heapy/tree/master/spec/fixtures/dumps) (carefull is 78mo text file)
@@ -108,6 +110,8 @@ Here is a list of questions I have. Feel free to make a PR to answer them.
108110

109111
* Why people are always scared about time spent in GC when the Newrelic graph of my app show an average time spent in GC that is 0.0676% ?
110112

113+
Personal opinion - most people *assume* garbage collection takes a lot of time in a GC'd language. GC languages are slower than non-GC'd languages, therefore it must be GC that is slow. However, it's not just *GC* but *allocation* and the record keeping that goes along with it that slows Ruby programs. Creating an object isn't just the simple process of writing to some memory location, we have to do a bunch of checks, look for free space in the ObjectSpace, etc etc. So a GC'd language *is* slower, but we actually incur most of the cost *while running the program*, not *when garbage collecting*.
114+
111115
* Why when using a frozen string we don't allocate memory ?
112116
I use a method because it represents "patterns" we discuss with my team, I try to measure the number of allocations betweens calling directly string, calling a string set into a constant outside the function and calling a string frozen in a constant outside the function.
113117

0 commit comments

Comments
 (0)