LeakCanary reports 0 distinct leaks but often dumps hprof files - leakcanary

According to LeakCanary, my app has 0 "distinct leaks", but I find many .hprof files on the phone. What does that mean? I opened some of the files with leakcanary but don't see strange things (I am novice). What should I do?

Related

Clear workspaceStorage folder for Visual Studio Code

I do a lot of C++ development using Visual Studio Code on Windows 10. My development computer has limited hard disk capacity and Low disk space warnings are frequent.
After analysis with the excellent WinDirStat utility, %APPDATA%\Code\User\workspaceStorage was found to contain hundreds of MBs. There are dozens of random 32-character folders (eg. "9731bc4ee103e04b5a91aff76967e74b"), and each of these containing .\ms-vscode.cpptools\.BROWSE.VC.DB files which are typically >30 MB.
Can these files, or better the entire %APPDATA%\Code\User\workspaceStorage folder, be safely deleted with a batch script on Windows startup?
You can change the storage path of the database files. After that, I think the database files can be deleted safely.
Add this to the global settings.json file:
"C_Cpp.default.browse.databaseFilename": "${workspaceFolder}/.vscode/.BROWSE.VC.DB"
See more details here
BTW, you can also set "C_Cpp.intelliSenseCachePath" to change the IntelliSense cache path.
Learn more from this issue and official docs

DumpCount in WER doesn't work precisely

I work on a Windows 64-bit PC. My application launches 10+ instances of a 32-bit process with the same name, Proc.exe. These instances are launched very close in time; in a certain scenario they crash, also very close in time.
I try to collect crash dumps for these crashes, using WER. I use the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\Proc.exe, as explained in "Collecting User-Mode Dumps" MSDN article. I use the full dump (DumpType=2). In the target dump folder I obtain a number of dump files whose names differ by the PID number: Proc.exe.1836.dmp, Proc.exe.5428.dmp, etc.
The problem: the total number of the generated dump files is not always exactly according to the value of DumpCount, often there are more files, and their actual number varies from run to run. I saw up to 5 files for DumpCount=1, and up to 8 files for DumpCount=3.
I tried to work with the global LocalDumps settings (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps) instead of the per-process settings, and the results are similar.
It's important for me to control the number of the generated dump files, since the free disk space is very limited.
Do I miss something, or what I reported now is a bug in Windows?

VS2013 C++ : slow linking process

Have you ever experienced a slow linking process in a C++ project compile (I'm using VS2013)? I get linking process taking 15 minutes after a 5 minutes Build. A Rebuild or Visual Studio restart does not fix the issue.
Task manager shows mspdbsrv.exe taking a full core (25% on a 4-core), and pdb file creation is very slow, Kb after Kb it reaches 50 Mb.
Additional info:
the same project on another computer build and link in acceptable time.
antivirus is disabled
I've tried changing the pdb file creation location: no success
I've set the linker output Verbose, but it stops at one debug row and then wait all the time there.
VS2013 is updated to SP4
Hard disk activity led on my laptop is mostly turned off, so there's no full activity on the disk.
I'm running Windows 7 Pro.
VS2013 is run with administrator rights
Thank you.
Fixed changing "Debug Information Format" from /ZI (Edit and Continue feature) to /Zi. I still have no clue why this cause a slow linking only on a specific computer and not for the others. Hope this could help people coming here for the same issue.
Is it using Link-Time Code Generation? On VS2010 that step was single threaded so it takes much longer than the apparent compile step. On later versions this step was improved to be multithreaded, according to blog posts. It also mentioned that PDB access is a bottleneck. So, maybe you have an old mspdbsrv.exe on that system? Look at the version info on the file, compared across machines. There might also be some option to control its locking and multi-use behavior, hidden away someplace.

How is WinDbg used, what exactly is it, and does it relate to .dmp files?

In the past, I have heard references to parsing .dmp files using WinDbg (I think - I might be wrong).
I have also done fairly extensive debugging with the help of .map files, and I have done extensive debugging using standard logical heuristics and the Visual Studio debugger.
However, occasionally, the program I am developing crashes and creates a .dmp file. I have never been able to interpret the .dmp file. A while ago, I posted a SO question regarding how to interpret .dmp files ( How to view .dmp file on Windows 7? ), but after somewhat significant effort I was unable to figure out how to interpret .dmp files using the answer to that question.
Today, I was viewing an unrelated SO question ( C++ try/throw/catch => machine code ), and a useful comment underneath the accepted answer has, once again, made reference to WinDbg.
If you really want to find this out though, it's easy - just trace
through it in WinDbg
I would like to follow this advice. However, for me, it's not easy to "just trace through it in WinDbg". I've tried in the past and can't figure out what exactly this means or what to do!
So, I'm trying again. "For once and for all", I would like to have plain-and-simple instructions regarding:
What is WinDbg
Assuming WinDbg is related to .dmp files, what exactly is a dump file and how does it relate to WinDbg (and correct me if my assumption is wrong)
How do you create .dmp files and, correspondingly, how do you use WinDbg to analyze them (again, correct me if I'm wrong about the relationship between WinDbg and .dmp files).
If you could please answer this question from the "starting point" of a programmer who ONLY has Visual Studio installed and running.
Thanks!
WinDbg is a multipurpose debugger. It can debug a live process by attaching, set breakpoints, etc like you would with any other debugger. It can also analyze crash dump files as well, which are .dmp files. It functions by you giving it commands.
A .dmp file is a memory dump of something. What that something is depends on what the memory dump is for. It could be for a process, for example. It could also be for the kernel. What is in the memory dump depends, too. In your case, it's probably what your process looked like at the time of it crashing. What the memory dump contains can vary depending on the dump type.
There are various ways. On Windows Vista+, Server 2008+ - you can do it right from the task manager. Right click the process, and click "Create Memory Dump". WinDbg can make a memory dump from a live process too by using the .dump command. Other tools like adplus can be used to automatically create a memory dump on certain conditions, like when a process exceeds a memory or CPU threshold, or when it crashes.
WinDbg can open a Crash Dump easily enough. What is important is that you get your symbols loaded correctly, first. Usually in the form of .pdb files or from a symbol server (though not necessary, or always possible, it is greatly helpful).
Once you have WinDbg running, take a look at the list of commands available to poke around in your crash dump.
WinDbg is a Gui version of the command line debugger cdb.exe, both are user-process and kernel mode debuggers, it uses DbgHelp.dll to issue commands to your application or NT kernel (you can also do the same as it has an api).
.Dmp files are memory dumps of varying detail, some can have minimal detail enough for call stacks of all threads, whilst others will put the entire user-mode memory, handle information, thread information, memory information etc.. see this for more info. So dump files have nothing to do with WinDbg, other than it can open them, incidentally you can open .dmp files in Visual Studio
Like #vcsjones has already stated you can do this using task manager (at least you can from Vista onwards), you can use procdump, you can do this once WinDbg is attached, I usually do a full mini dump like this: .dump /ma c:\mem.dmp, you can also set Windows to do this when a crash happens using Dr. Watson
However, you must have the symbols for Windows and your application in order to be able to generate sensible call stacks, note that for obvious reasons you cannot step through or set breakpoints in a a memory dump, you can only do this for a live process. You can also have WinDbg attach non invasively, so Visual Studio could be attached and you can attach WinDbg non invasively and use the toolset in WinDbg to assist debugging.
For me the main advantage of WinDbg is its free, it is a small download and install, it is fast, it has a very rich toolset for diagnosing problems that are either difficult or impossible to do using visual studio.

Magento: "core.13528" files?

Some files showed up mysteriously in my Magento shop home folder, they're all named core.13528, core.13529...there's about 40 of them, and all take up to 400MB!!
Does anyone know what do they mean and how did they got there? Can I delete them?
These are core dumps - memory images from failed processes. You don't need them unless you are in a position to analyze program crashes with a debugger (or if you submit bug reports to the authors who are).
However, if the numbers (usually process IDs) are consecutive, it looks like your processes always crash eventually - this should be a cause of worry.

Resources