<commit_before>sizeof4j
========

[![Build Status](https://api.travis-ci.org/repositories/arturmkrtchyan/sizeof4j.png)](https://travis-ci.org/arturmkrtchyan/sizeof4j)
[![Coverage Status](https://img.shields.io/coveralls/arturmkrtchyan/iban4j.svg)](https://coveralls.io/r/arturmkrtchyan/sizeof4j)
[![License](http://img.shields.io/:license-Apache 2.0-blue.svg)](https://raw.githubusercontent.com/arturmkrtchyan/iban4j/master/LICENSE.txt)

A Java library for measuring memory size of Java objects.

```java
class Main {

    public static void main(String[] args) {

        JvmUtil.printAll();

        System.out.println("\n\nSizeOf");
        System.out.println("=================================");
        System.out.println("byte:       " + SizeOf.byteSize());
        System.out.println("boolean:    " + SizeOf.booleanSize());
        System.out.println("short:      " + SizeOf.shortSize());
        System.out.println("char:       " + SizeOf.charSize());
        System.out.println("int:        " + SizeOf.intSize());
        System.out.println("float:      " + SizeOf.floatSize());
        System.out.println("long:       " + SizeOf.longSize());
        System.out.println("double:     " + SizeOf.doubleSize());

        System.out.println("--------------------------");
        System.out.println("Object:     " + SizeOf.shallowSize(Object.class));
        System.out.println("Integer:    " + SizeOf.shallowSize(new Integer(2)));
        System.out.println("String:     " + SizeOf.shallowSize(new String("aaa")));

        System.out.println("--------------------------");
        System.out.println("A:          " + SizeOf.shallowSize(new A()));
        System.out.println("B:          " + SizeOf.shallowSize(new B()));
        System.out.println("C:          " + SizeOf.shallowSize(new C()));
        System.out.println("C[2]:       " + SizeOf.shallowSize(new C[]{new C(), new C()}));
    }

    private static class A {
        private int i;
    }

    private static class B {
        private int i;
        private java.util.Locale l = java.util.Locale.US;
    }

    private static class C {
        private int i;
        private java.util.HashMap hm = new java.util.HashMap();
    }

}
```

![Compatibility Badge](https://java.net/downloads/adoptopenjdk/compat.svg)

<commit_msg>Added code coverage to README<commit_after>sizeof4j
========

[![Build Status](https://api.travis-ci.org/repositories/arturmkrtchyan/sizeof4j.png)](https://travis-ci.org/arturmkrtchyan/sizeof4j)
[![Coverage Status](https://img.shields.io/coveralls/arturmkrtchyan/sizeof4j.svg)](https://coveralls.io/r/arturmkrtchyan/sizeof4j)
[![License](http://img.shields.io/:license-Apache 2.0-blue.svg)](https://raw.githubusercontent.com/arturmkrtchyan/iban4j/master/LICENSE.txt)

A Java library for measuring memory size of Java objects.

```java
class Main {

    public static void main(String[] args) {

        JvmUtil.printAll();

        System.out.println("\n\nSizeOf");
        System.out.println("=================================");
        System.out.println("byte:       " + SizeOf.byteSize());
        System.out.println("boolean:    " + SizeOf.booleanSize());
        System.out.println("short:      " + SizeOf.shortSize());
        System.out.println("char:       " + SizeOf.charSize());
        System.out.println("int:        " + SizeOf.intSize());
        System.out.println("float:      " + SizeOf.floatSize());
        System.out.println("long:       " + SizeOf.longSize());
        System.out.println("double:     " + SizeOf.doubleSize());

        System.out.println("--------------------------");
        System.out.println("Object:     " + SizeOf.shallowSize(Object.class));
        System.out.println("Integer:    " + SizeOf.shallowSize(new Integer(2)));
        System.out.println("String:     " + SizeOf.shallowSize(new String("aaa")));

        System.out.println("--------------------------");
        System.out.println("A:          " + SizeOf.shallowSize(new A()));
        System.out.println("B:          " + SizeOf.shallowSize(new B()));
        System.out.println("C:          " + SizeOf.shallowSize(new C()));
        System.out.println("C[2]:       " + SizeOf.shallowSize(new C[]{new C(), new C()}));
    }

    private static class A {
        private int i;
    }

    private static class B {
        private int i;
        private java.util.Locale l = java.util.Locale.US;
    }

    private static class C {
        private int i;
        private java.util.HashMap hm = new java.util.HashMap();
    }

}
```

![Compatibility Badge](https://java.net/downloads/adoptopenjdk/compat.svg)


{'fraction_non_alphanumeric': 0.20260303687635575, 'fraction_numerical': 0.004338394793926247, 'mean_word_length': 2.533333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6009990', 'n_tokens_mistral': 1459, 'n_tokens_neox': 1432, 'n_words': 206}