I've used the Dump HPROF File option in eclipses DDMS and made my hprof file called in.hprof, but when I try to do the hprov-conf in.hprof out.hprof from the command line it gives me the error "Error: expecting 1.0.3". Any ideas?
Never found out why it was giving me the error, but instead of trying to convert it and open it in the external MAT I ended up using the built in tool for Eclipse which worked perfectly and is much simpler. One click instead of exporting, converting and opening in a different window.
Related
I am trying to build an android application with OF. The application runs in two other computers. However, it does not work on mine. I am using a mac.
I run the command "make AndroidDebug" in the project folder, and this is the error I have:
/Library/openFrameworks/addons/ofxHTTP/libs/ofxHTTP/src/PostRouteFileHandler.cpp:98:46: error: invalid use of incomplete type 'class Poco::Path'
ss << Poco::Path(formFileName).getExtension();
I have installed poco, but nothing changes afterwards.
What can I do to solve this?
Thanks
Have you included Poco/Path.h?
A forward declaration might appeared earlier (possibly in another header) without complete definition.
This seems to be a question asked many times. I'm using Eclipse to write an Android app, in OS X. So far, no problem, except the app crashes sometimes, and I want to see whats going on so I can fix the problem. (Its probably related to bitmaps or variables not recycling correctly. But I don't know where else to start to look into it.)
I used the DDMS tool (in eclipse) to create a dump file. Then I downloaded the MemoryAnalyzer application to open it. Here is where I have been stuck for an hour: I have to convert the file first because Eclipse writes the hprof file in a different format. How do I convert it?
The answers to this question, error openning HPROF file, directly address my question. The top answer is the same as the reference for the hprof-conv tool.
The hprof file you get from Android has android specific format. You should convert hprof >file take from Android OS into standard hprof format. For this you can use hprof-conv tool >that is located at AndrodiSDK/tools/hprof-conv.
For example:
hprof-conv android.hprof mat.hprof
And then open mat.hprof in Memory Analyzer.
I have a couple problems with this.
when I open the hprof-conv tool, it shows a handful of lines about it then says "[Process completed]". And there is no place to enter any text. The only relevant info on the screen is this:
Usage: hprof-conf infile outfile
I'm in Terminal, so I open "new command..." or tried using the shell thats also open. Then when I run "hprof-conv dump1.hprof dump1a.hprof" I get the error "command not found". So I think I'm off track. I also tried "hprof-conf", instead of "hprof-conv", the way it suggests in point 1. Same error. Also tried various paths to the file, no change.
if I was on the right track, how do I correctly point this command to the file location? I have it on my desktop, and its named dump1.hprof. I'm not very experienced with Terminal.
Thanks in advance for an answer, or perhaps another suggestion on how to hunt down a memory leak.
If you are on mac add a ./ before the command :
./hprof-conv infile.hprof outfile.hprof
Hello and sorry for a late response. I just went through exactly this problem and wrote some instructions here: http://spragucm.wordpress.com/2013/11/21/debugging-android-project-ddms-heap-dump-in-eclipse/
Method 1: Use the Standalone MAT
go into c:...\sdk-tools\tools and copy hprof-conv.exe
go to whatever folder you saved your dump1.hprof file and paste the .exe file
open a terminal and change directory to the folder with your dump and .exe file (e.g. if folder is c:\Users\YourName\DumpFolder then type cd c:\Users\YourName\DumpFolder)
When you're in the folder type the following in the command prompt and hit enter: hprof-conf infile.hprof outfile.hprof
NOTE: If you get an error about directory not found, you're not in the correct directory in the command prompt
The outfile.hprof file should be in the same folder as the other files.
Method 2: Using MAT in Eclipse
Install the plug-in for MAT in Eclipse
Select to get heap dump as before
Go to Window->Open Perspective->other->Memory Analysis
Look through your tabs for a window with a blue disk icon in top left and expand the tab (this will have some crazy name on it with a very long string of numbers)
Done...you are looking at the heap dump in Eclipse
I had got out of memory exception error.I came to Know that I had a memory leak in my app. Thats why I installed MAT.and I dumped the hprof file.
But while opening that .hprof file I got error like...
Error opening heap dump 'ind.hprof'. Check the error log for further details.
Unknown HPROF Version (JAVA PROFILE 1.0.3) (java.io.IOException)
Unknown HPROF Version (JAVA PROFILE 1.0.3)".
And I had converted the hprof file by using "hprof-conv fil.hprof file2.hprof". Its Showing like "hprof-conv" command not exists.And I have tried by setting Hprof Action to Open in eclipse in DDMS. But its not working.
You have to convert it first in order to use it in MAT.
you can use hprof-conv tool that is located at AndroidSDK/platform-tools/hprof-conv
hprof-conv android.hprof mat.hprof
Then try opening the converted file in MAT.
I got the solution. I used "./hprof-conv file.hprof mat.hprof" instead of "hprof-conv file.hprof mat.hprof"
Thanks
I have to search for memory leaks in an Application at the moment and have a workflow problem. This ( http://android-developers.blogspot.com/2011/03/memory-analysis-for-android.html ) blog post states:
If you're running ADT (which includes a plug-in version of DDMS) and
have MAT installed in Eclipse as well, clicking the “dump HPROF”
button will automatically do the conversion (using hprof-conv) and
open the converted hprof file into Eclipse (which will be opened by
MAT).
But wen I press the button within eclipse and try to open the hprof file I get this error - so I still have to do the conversion:
Error opening heap dump 'com.baseapp.foo.hprof'. Check the error log
for further details. Error opening heap dump
'com.baseapp.foo.hprof'. Check the error log for further details.
Unknown HPROF Version (JAVA PROFILE 1.0.3) (java.io.IOException)
Unknown HPROF Version (JAVA PROFILE 1.0.3)
anyone knows what I am doing wrong here? I am using ADT 16
I had this issue on my setup also, it seems there is a certain series of steps that cause eclipse to default to saving to a file (instead of doing the conversion and opening it).
Anyway to fix it:
Preferences (The global Eclipse ones) -> Android -> DDMS -> HPROF Action -> set to "Open in Eclipse" (Mine was previously on "Save to Disk")
Convert hprof file take from Android OS into standard hprof format. For this you can use hprof-conv tool that is located at AndrodiSDK/tools/hprof-conv.
Like this
hprof-conv android.hprof mat.hpof
And then open mat.hprof in Memory Analyzer.
The error message indicates that there are additional details in the error log (Window > Show View > Error Log). Can you clear the log, then reproduce the problem, then see what if anything appears in the error log to help pinpoint the problem?
I get this message all the time on my error log:
Could not create the view: Could not initialize class com.ibm.icu.impl.JavaTimeZone.
This situation its bad: each time when I try to open a class I get this message.
What should I do to solve this problem?
see this buddy:What does "Could not initialize class com.ibm.icu.impl.JavaTimeZone" mean?
It could be not related to android, but to your Eclipse version and current platform.
In case it is relevant, the blog post "Could not initialize class com.ibm.icu.impl.JavaTimeZone Error" (by Derek Helbert) could be helpful.
(But only for Eclipse 3.6 on MacOs)
If you are having a serious pain trying to run Eclipse Helios in Mac OS x 10.5.8 and keep getting errors such as the following:
java.lang.NoClassDefFoundError
--or--
An internal error occurred during: "Could not initialize class com.ibm.icu.impl.JavaTimeZone error".
Here is an easy solution:
Edit eclipse.ini with your favorite text editor and add a line at the end "-Dcom.ibm.icu.util.TimeZone.DefaultTimeZoneType=ICU".
It's inside Eclipse.app/Contents/MacOS/eclipse.ini.
Another solution is the following:
Decompress the com.ibm.icu_4.0.1.v20090822.jar file in the eclipse/plugins folder to any directory you like.
If you cannot find the exact version, just decompress the IBM ICU JAR that's shipped with your version of Eclipse.
In that directory, open the file com/ibm/icu/ICUConfig.properties
Replace
com.ibm.icu.util.TimeZone.DefaultTimeZoneType = JDK
with
com.ibm.icu.util.TimeZone.DefaultTimeZoneType = ICU
Recompress the com.ibm.icu_4.0.1.v20090822.jar file in the eclipse/plugins folder with the modified file
However, it has been pointed out that editing the jar makes it unsigned.
Ran into the same problem with Ubuntu 12.04 and fixed it with:
apt-get --reinstall install tzdata-java