Skip to content

Instantly share code, notes, and snippets.

View karthickvkumar's full-sized avatar
🎯
Focusing

Karthick Kumar karthickvkumar

🎯
Focusing
View GitHub Profile
@karthickvkumar
karthickvkumar / memorySizeOfObject.js
Created April 4, 2017 07:25
calculate memory size of javascript object, it is not a accurate value!
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
break;
case 'string':