Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nateberkopec authored and benoittgt committed Apr 8, 2017
1 parent e1bba26 commit 83a974f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Here is a list of questions I have. Feel free to make a PR to answer them.

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

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".

* **[Answered]** What are the first line of a heap dump that are not address ?

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

* 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% ?

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*.

* Why when using a frozen string we don't allocate memory ?
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.

Expand Down

0 comments on commit 83a974f

Please sign in to comment.