Retrofit + RealmList + Gson stuck in a loop until out of memory
<p>I'm trying to user Retrofit + Realm + Gson, but when the RealmList is used the app get stuck.</p>

<p>If I remove the RealmList objects everything work's fine, but I need the object list.</p>

<p>Logcat:</p>

<pre><code>(32099): Background sticky concurrent mark sweep GC freed 278516(15MB) AllocSpace objects, 0(0B) LOS objects, 25% free, 23MB/31MB, paused 2.533ms total 1.049s
(32099): Background partial concurrent mark sweep GC freed 137132(8MB) AllocSpace objects, 0(0B) LOS objects, 40% free, 23MB/39MB, paused 4.211ms total 188.951ms
(32099): Background sticky concurrent mark sweep GC freed 271335(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 3.998ms total 236.868ms
(32099): Background sticky concurrent mark sweep GC freed 143812(8MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 24MB/32MB, paused 6.470ms total 201.800ms
(32099): Background partial concurrent mark sweep GC freed 159223(9MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 5.524ms total 215.809ms
(32099): Background sticky concurrent mark sweep GC freed 278158(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.922ms total 201.617ms
</code></pre>

<p>Json:</p>

<pre><code>[
{
  "id": "1",
  "title": "Subcategory 1",
  "color": "FF0000",
  "tabs": [
    {
      "id": "1",
      "title": "Tab 1"
    },
    {
      "id": "2",
      "title": "Tab 2"
    }
  ]
},
{
  "id": "2",
  "title": "Subcategory 2",
  "color": "DD0000",
  "tabs": [
    {
      "id": "1",
      "title": "Tab 1"
    },
    {
      "id": "2",
      "title": "Tab 2"
    }
  ]
}
]
</code></pre>

<p>Subcategory class:</p>

<pre><code>public class Subcategory extends RealmObject {

@SerializedName("id")
private String id;
@SerializedName("title")
private String title;
@SerializedName("color")
private String color;

@SerializedName("tabs")
private RealmList&lt;Tab&gt; tabs;

... sets &amp; gets ...

}
</code></pre>

<p>Tab class:</p>

<pre><code>public class Tab extends RealmObject {

@SerializedName("id")
private String id;
@SerializedName("title")
private String title;

... sets &amp; gets ...
}
</code></pre>

<p>RestClient use:</p>

<pre><code>Retrofit retrofit = new Retrofit.Builder()
            .baseUrl(BASE_URL)
            .addConverterFactory(GsonConverterFactory.create())
            .build();

services = retrofit.create(Services.class);

services.getSubcategories().enqueue(new Callback&lt;RealmList&lt;Subcategory&gt;&gt;() {
        @Override
        public void onResponse(Response&lt;RealmList&lt;Subcategory&gt;&gt; response) {
            Log.e(TAG, "Size: " + response.body().size());
        }

        @Override
        public void onFailure(Throwable t) {
            t.printStackTrace();
        }
    });
</code></pre>

<p>Libs:</p>

<pre><code>compile 'io.realm:realm-android:0.87.0'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
</code></pre>