TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Building Memory-efficient Java Applications

85 点作者 markerdmann超过 13 年前

10 条评论

DanielRibeiro超过 13 年前
Very nice presentation. However much of this can be actually discovered and felt first hand just by playing with profilers that support memory profiling (such as yourkit[1]).<p>After a few hours playing with it, you will never forget the precious lessons on this presentation.<p>[1] <a href="http://www.yourkit.com/" rel="nofollow">http://www.yourkit.com/</a>
NSMeta超过 13 年前
This is probably an 'apple and oranges' type of question, but I haven't used Erlang, nor Java to build large applications.<p>Does anyone know how Erlang compares to Java in regards to memory usage/performance?
评论 #3542493 未加载
评论 #3542639 未加载
评论 #3542212 未加载
评论 #3542228 未加载
joshhart超过 13 年前
For those of you who may not be familiar with them, using <a href="http://fastutil.dsi.unimi.it/" rel="nofollow">http://fastutil.dsi.unimi.it/</a> collections instead of Java collections is essentially the work-around for most things you'll use. Fastutil has custom classes that remove the pointer overhead associated with storing primitives. Unfortunately, Java really falls apart at the primitives aren't objects thing when it comes to performance.
insom超过 13 年前
It just goes to show that whatever language you use, you need to understand what the abstractions are doing: what bytes are really going where?
dasmoth超过 13 年前
Some (not all) of these cases would be helped massively if the JVM gained an equivalent of the fixnum/flonum types from the LISP world. This has been proposed kind-of seriously in the past, e.g.:<p><a href="http://blogs.oracle.com/jrose/entry/fixnums_in_the_vm" rel="nofollow">http://blogs.oracle.com/jrose/entry/fixnums_in_the_vm</a><p>Has anyone seen anything more recent?
gtani超过 13 年前
from 2008. slide 25:<p><i>experiments on a sampling of different JVMs.</i><p>More recent :<p><a href="http://vanillajava.blogspot.com/2011/07/java-getting-size-of-object.html" rel="nofollow">http://vanillajava.blogspot.com/2011/07/java-getting-size-of...</a><p><a href="http://vanillajava.blogspot.com/2011/07/java-how-much-memory-do-different.html" rel="nofollow">http://vanillajava.blogspot.com/2011/07/java-how-much-memory...</a><p><a href="http://kohlerm.blogspot.com/2008/10/knowledge-about-much-memory-things-need.html" rel="nofollow">http://kohlerm.blogspot.com/2008/10/knowledge-about-much-mem...</a><p><a href="http://kohlerm.blogspot.com/2009/02/how-to-really-measure-memory-usage-of.html" rel="nofollow">http://kohlerm.blogspot.com/2009/02/how-to-really-measure-me...</a><p><a href="http://marxsoftware.blogspot.com/2011/12/estimating-java-object-sizes-with.html" rel="nofollow">http://marxsoftware.blogspot.com/2011/12/estimating-java-obj...</a><p>(i have zillions bookmarks on this)
jesperhh超过 13 年前
Does anyone know of a similar study of memory efficiency in C# (or the CLR in general)?
dikanggu超过 13 年前
Cool! Very good explanations.
morsch超过 13 年前
TreeMap&#60;Double, Double&#62;, 100 entries, 8.6 kB, 82% overhead<p>Man, that's just annoying.
sjwright超过 13 年前
That's great, but perhaps they should teach some of this to their colleagues at IBM first.