i am trying to get LeakCanary to log to logCat - leakcanary

I have leakCanary installed and working but I never see logcat messages for it. I would also like to see the dump file in Android Studio as well. It is not clear to me how to do this. (I have not worked much with the memory analyzer yet)

Check if you have any filters in Logcat window. Type Leak in input and you'll be able to see something like:
04-26 11:26:51.990 1548-1875/your.package.debug D/LeakCanary: Analysis in progress, working on: FINDING_LEAKING_REFS
04-26 11:26:51.990 1548-1875/your.package.debug D/LeakCanary: Analysis in progress, working on: FINDING_SHORTEST_PATHS
04-26 11:27:00.590 1548-1581/your.package.debug D/LeakCanary: Checking retained references because had pending heap dump
04-26 11:27:00.590 1548-1581/your.pacakge.debug D/LeakCanary: Leak Analysis in progress, will retry in 20000 ms

Related

DebugDiag Perf Analysis fails with error System.ArgumentException

I am trying to debug high CPU usage in an IIS app pool on a Windows 2012 R2 server. I have installed DebugDiag v2 Update 3 and collected dumps of the IIS app pool whenever its CPU usage goes above a specified threshold.
I was able to get 11 dumps generated - 10 mini dumps and 1 full dump. However, when I open the DebugDiag Analysis tool and load any (or all) of the dump files and do a PerfAnalysis, it always fails with the error System.ArgumentException, no matter what I try. I have tried to do this multiple times, and I still get the same error every time I try to analyse the files.
Has anyone been able to successfully do a Perf Analysis? I tried the crash analysis and it seems to work fine; it's only the Perf Analysis which errors out.
Here is the kind of error I see every time I try to do a PerfAnalysis:

Merging of ETL files has failed (0x80070070) (Flags: 0x0000011f)

Trying to profile my command line application in VS 2017 on a W10 machine with April 2018 Update, VS fails to create the report.
The UI says Microsoft Visual Studio was unable to create a diagnostics report. Check Output window for errors.
The Output window says
Profiling of 'Program' started.
Program has exited.
Profiling of 'Program' stopped.
Diagnostics session stopped with errors.
Merging of ETL files has failed (0x80070070) (Flags: 0x0000011f).
Previous search gives little answers as to why, but the problem seems related to Windows' event logging service. Comments on this similar question suggest it's related to disk occupation, but with no source. My SSD is indeed almost full, but with 6 GB of free space.
I resolved the issue, the multiple times it happened, by restarting windows and then start the profiling as first thing as the OS is ready. On a fresh start it works, but going further with changes and profiling it eventually appears again.
If someone knows a long-term solution feel free to add.
Code 0x80070070 "There is not enough space on the disk." Your disk was full, or became full during a build or other operation as temporary files were created.

How to force WatchOS to generate app crash logs?

I am developing an application that needs to record a lot of data, which should be sent to the iPhone later. I am using CoreData and sometimes the quantity of memory used reaches 100 MBs, and also the CPU can reach 100%. I can see this during debug, but during debug the app doesn't crash because there are no memory/CPU limits. So the problem is that every time that I use the app without debugging, it may crash every 2-3 minutes but no crash log is generated, and I can't understand why and in what line of code it crashes. Is there a way to force WatchOS generating the crash logs?
Edit
If at least there is a way to debug the application with real memory/CPU limits (which are nonexistent in debug mode), so that I can understand why and where it crashes, or if there is any way to make some diagnostic to understand the unexplainable crashes, please let me know.

Debug Diagnostic not generating dumps on Crash

I have configured DebugDiag to monitor all app pools for crashes. One of our App pool stopped today but DD did not generate any dump files. Event Viewer shows the error:
Application Poole is being automatically disabled due to a series of failures in the processes serving that application Pool.
Currently there are no breakpoints added to DD and first chance exception is not enabled.
Are they really required to get the dump generated? Any special IIS Config required?
I'm on win 2003 with Debug Diag 1.2.
It has generated dumps in the past for memory but haven't seen any crash dumps so far.
Your help will be greatly appreciated, pleaseee guide.

Does Visual C++ debug build identify heap corruption errors?

I have been struggling to detect a memory corruption error in our product. The memory detection tools like valgrind only tell the problem at the time of the crash, not when the corruption actually occurs. I have seen while using debug builds that it will check the memory area before and after the block being freed, and show a debug assertion failure saying a heap corruption has occured. So can I rebuild my product in debug mode to capture the error right when it occurs? Will it also catch buffer overruns etc? I could not find any information on the internet about debug builds being targetted towards memory error detection.
You can use as well the 'Page Heap' available on every version of Windows.
You can use gflags that comes along to Debugging Tools for Windows to configure Full Page Heap for your application.
You can then run your application, even in retail mode, under the debugger. The debugger will stop once you encounter a buffer overrun or access to freed memory.
I like very much this tool, because it is built in the OS, an can even be activated on a customer site (gflags only sets registry keys and you can simply send these keys to your customer).
Some people are afraid when we mention (Debugging Tools for Windows). You can use Visual Studio to diagnose the problem. The only thing you need are the PDBs corresponding to your binaries (you can generate them even for release builds).
I am not sure about the debug builds, but for a nice overview of memory corruption tools you might look at http://code.google.com/p/address-sanitizer/wiki/ComparisonOfMemoryTools. It list Valgrind and what it should be able to check for you.
"C++" is not a compiler; vendors make their own according (more or less) to the standard specs.
I only have experience with Microsoft's, and I can tell you that it checks heap corruption by allocating "sentries" around each new or malloc block (in debug mode only, of course) and filling them with a special pattern (was 0xCD when I last used it), and then it checks the guards for every write around that location. If they changed, you'll get a run-time error saying the heap got corrupted.
By the way, buffer overflows are heap corruption.
Edit to add a reference: http://msdn.microsoft.com/en-us/library/8wtf2dfz.aspx

Resources