bad design of Android’s task management model

March 11, 2011 Leave a comment

Android’s task manager (long pressing HOME key) will list both the recently closed Application(s) and Running Application(s), thus it obscure the traditional border, which is clear to both the user and developer in past time, between this two concepts/semantics, and, hence, put much more effort/confusion/complexity on developers to adapt to this new model, and the end users will be confused/mislead by this new model too – thought the app closed as usual (the user thought), but due this new model, the app still kept the data (the app’s developer designed to follow Android’s way) the user entered which the user do not want it be viewed at late time for some reason, or due to the developers design, the data did not persisted as the application seems to be “closed”, but at late time, the device crashed and so the data lost, or due to developers on purpose design to do some user unwanted background jobs when the application “closed”!

It changed the semantics of closing application which adopted for decades, and make things much more unnecessary complex and put the user in front of PRIVACY LEAKING, DATA LOST, UNWANTED and UNSTOPPABLE BEHAVIOUS/APPLICATIONS, and LOST CONTROL!



WTP with Maven (M2E plugin) not to copy jar when deploy

June 25, 2010 Leave a comment

Eclipse 3.5 jee Galileo SR2 + WTP + M2Eclipse

no jars managed by maven were copied to WEB-INF/Lib, but the war that maven generated has those jars, it is very weird, no reasult found thru google, solved it by myself finally – simply add a classpath entry to tomcat’s lanuch configuration is enough

Categories: Uncategorized Tags:

how to get Java heap dump

June 25, 2010 Leave a comment

C:\Program Files\Java\jdk1.6.0_20\bin>jmap
jmap -histo <pid>
(to connect to running process and print histogram of java object heap
jmap -dump:<dump-options> <pid> 
(to connect to running process and dump java heap)

format=b binary default
file= dump heap to

Example: jmap -dump:format=b,file=heap.bin

or, run jconsole, select MBeans -> -> HotSpotDiagnostic -> Operations -> dumpHeap, fill p0 as deisred dump file path (if using Eclipse Mempry Analyzer to analyze it, the file extension is better to be .hprof), click dumpHeap button to dump it.

or, generate it using Eclipse Memory Analyzer directly
Acquire heap dump from a locally running VM in Eclipse Memory Analyzer in Eclipse

or, let jvm generate it when out of memory: add -XX:+HeapDumpOnOutOfMemoryError or -XX:+HeapDumpOnCtrlBreak, more details here:

ps: dump file can be parsed by Eclipse Memory Analyzer

Finding Memory Leaks
Start by running the leak report to automatically check for memory leaks.
This blog details How to Find a Leaking Workbench Window.
The Memory Analyzer grew up at SAP. Back then, Krum blogged about Finding Memory Leaks with SAP Memory Analyzer. The content is still relevant!

Analyzing Java Collection Usage
Check out Krum’s blog about Analyzing Java Collections Usage with Memory Analyzer. Also, Memory for Nothing looks unused collections and the memory kept alive.

Perm Space Issus
good starting point is the blog The Unknown Generation: Perm by Andreas.
Also, Vedran has blogged some hints how to address Perm Space Issues.

Categories: Uncategorized Tags: