V8: an open source JavaScript engine
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about V8 internals, such as object layout, memory allocation and heap profiling, as a primary-source explanation from the engine's lead.
Recommended by 1 people across 1 different months, 2012 to 2016.
What it is
A short 2008 explainer in which Google engineer Lars Bak describes the main engineering decisions behind V8, the JavaScript engine used in Chrome. It covers topics such as hidden classes, memory handling and how the engine runs JavaScript quickly.
Cited in 2 Wikipedia articles, including V8 (JavaScript engine), Lars Bak (computer programmer).
What people said
Recommends loislo · 2013-09 · Stack Overflow · on “Chrome DevTools Profiler”
There are number of different v8 internal things in the heap that cannot be accessed from javascript. As example (script line ends) is an array that have line end offsets for a script. v8 needs it for setting up a breakpoint. Each time when you create an object, v8 does many things and allocates memory for them. See Lars Bak video about v8. [this video] If you are interesting in the topic there are number of slides and presentations about v8 internals. The simplest way to find a leak is to use "Record Heap Allocations" profile. It shows you a "realtime" chart with allocations. you need to start the recording, repeat your scenario a few times and if the code has a leak then you will see the same n
Cites RandomInsano · 2012-04 · Stack Overflow · on “JavaScript class memory usage”
Revisiting this a huge amount later, but it turns out V8 is smart enough that it doesn't create multiple instanced of that function in the first method. Go hidden classes :D [this video]
Cites loislo · 2013-12 · Stack Overflow · on “How do you find a javascript variable in the Chrome Dev Tools Heap Profiler?”
42 is not a heap object. The reason of that is performance and memory. If an integer fits into 31 bit (one bit is reserved for the marker pointer/non-pointer) then v8 stores it as is, otherwise v8 allocates a heap object for it. See [this video] So, in your case v8 reserves a slot in context, "associate" the name to the slot and stores 42 into the slot. In case of double, string, array or an object v8 will store pointer to it into the slot. Heap profiler scans heap for the heap objects. After that it scans the content of each heap objects for a pointers to the other objects. As a result it gets the heap graph. Thereby the heap graph doesn't contain plain integers.
Cites sheltond · 2016-02 · Stack Overflow · on “V8 JavaScript Object vs Binary Tree”
V8 uses the concepts of 'maps', which describe the layout of the data in an object. These maps can be "fast maps" which specify a fixed offset from the start of the object at which a particular property can be found, or they can be "dictionary map", which use a hashtable to provide a lookup mechanism. Each object has a pointer to the map that describes it. Generally, objects start off with a fast map. When a property is added to an object with a fast map, the map is transitioned to a new one which describes the location of the new property within the object. The object is re-allocated with enough space for the new data item if necessary, and the object's map pointer is set to the new map. Th