+ jcategories = new JsonObject();
+ jstats.add("categories", jcategories);
+
+ for (Category cat: config.getCategories())
+ try {
+ articles = provider.getArticles(cat);
+ jcategories.addProperty(cat.getLabel(),
+ articles.size());
+ } catch (IllegalArgumentException | FeedException | IOException e) {
+ LOG.log(Level.SEVERE, "Fail to retrieve articles", e);
+ }
+
+ jmemory = new JsonObject();
+ jstats.add("memory", jmemory);
+
+ runtime = Runtime.getRuntime();
+ jmemory.addProperty("total", runtime.totalMemory());
+ jmemory.addProperty("max", runtime.maxMemory());
+ jmemory.addProperty("free", runtime.freeMemory());