diagnostics

Method to dump classes on the classpath from inside JVM?

帅比萌擦擦* 提交于 2019-12-03 17:24:31
My code is failing with a ClassNotFoundException . I can see that the jar file containing the class is definitely on the classpath from the command prompt execution. Is there a way to dump the list of classes on the classpath from the JVM? (Ideally some Java code). (I don't want to see the classes in a directory, I want to see a list of what is loaded into the JVM). That's actually not what you want to see if you're getting a CNFE , since it's not found. Plus not all available classes will be loaded at any given time. Start by going through this list . But in general, if it's not found, it's

How to use GCC diagnostic pragma with C++ template functions?

不羁岁月 提交于 2019-12-03 16:22:27
I would like to use g++ and -Werror , so I have now to disable warnings for 3rd-party libraries I have no control of. The solution provided by http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html works very well, allowing simply to wrap the includes of 3rd party headers with pragmas. Unfortunately, that did no longer work for me in a certain setup where templates are involved. I created the following minimal example of where this approach did not work as expected: Source file main.cpp #pragma GCC diagnostic ignored "-Wunused-parameter" #include "hdr.hpp" #pragma GCC diagnostic error "

How to identify the caller of a Stored Procedure from within the Sproc

爷,独闯天下 提交于 2019-12-03 12:26:41
I have a deprecated stored procedure which should no longer be called from code, but there is some system which is still calling it. This is a production server so I have very limited indirect access to it for performing diagnostics. Is there any way to determine the machine which is calling a particular stored procedure from within the sproc? Something such as @@CallingMachineIP or @@CallingMachineName select hostname from master..sysprocesses where spid=@@SPID or select host_name from sys.dm_exec_sessions where session_id=@@SPID @@SPID should give you the current process ID. Then, select *

Process Memory Size - Different Counters

邮差的信 提交于 2019-12-03 11:48:42
问题 I'm trying to find out how much memory my own .Net server process is using (for monitoring and logging purposes). I'm using: Process.GetCurrentProcess().PrivateMemorySize64 However, the Process object has several different properties that let me read the memory space used: Paged, NonPaged, PagedSystem, NonPagedSystem, Private, Virtual, WorkingSet and then the "peaks": which i'm guessing just store the maximum values these last ones ever took. Reading through the MSDN definition of each

Measuring performance of ASP.NET MVC 3

大兔子大兔子 提交于 2019-12-03 09:23:10
问题 I've built a JSON service in ASP.NET MVC 3 and I want to be able to measure the execution time of the actions in my application (I want to it to automatically log slow actions). Therefor this looked great; http://coderjournal.com/2010/10/timing-the-execution-time-of-your-mvc-actions/ (It's been mentioned on places here on stack overflow as well) The problem is that I get measurements that MUST be wrong from this method; I've added another stopwatch that starts the first thing in the action

Measuring performance of ASP.NET MVC 3

房东的猫 提交于 2019-12-02 23:45:19
I've built a JSON service in ASP.NET MVC 3 and I want to be able to measure the execution time of the actions in my application (I want to it to automatically log slow actions). Therefor this looked great; http://coderjournal.com/2010/10/timing-the-execution-time-of-your-mvc-actions/ (It's been mentioned on places here on stack overflow as well) The problem is that I get measurements that MUST be wrong from this method; I've added another stopwatch that starts the first thing in the action and stops just before the return. Example: Stopwatch inside the method => 10ms (the serializing to json

What's the right statistic for iOS Memory footprint. Live Bytes? Real Memory? Other?

折月煮酒 提交于 2019-12-02 15:37:05
I'm definitely confused on this point. I have an iPad application that shows 'Live Bytes' usage of 6-12mb in the object allocation instrument. If I pull up the memory monitor or activity monitor, the 'Real Memory' Column consistently climbs to around 80-90mb after some serious usage. So do I have a normal memory footprint or a high one? This answer and this answer claim you should watch 'Live Bytes' as the 'Real Memory' column shows memory blocks that have been released, but the OS hasn't yet reclaimed it. On the other hand, this answer claims you need to pay attention to that memory monitor,

Why does the second for loop always execute faster than the first one?

谁都会走 提交于 2019-11-30 20:43:06
I was trying to figure out if a for loop was faster than a foreach loop and was using the System.Diagnostics classes to time the task. While running the test I noticed that which ever loop I put first always executes slower then the last one. Can someone please tell me why this is happening? My code is below: using System; using System.Diagnostics; namespace cool { class Program { static void Main(string[] args) { int[] x = new int[] { 3, 6, 9, 12 }; int[] y = new int[] { 3, 6, 9, 12 }; DateTime startTime = DateTime.Now; for (int i = 0; i < 4; i++) { Console.WriteLine(x[i]); } TimeSpan

Accessing Error log in shiny-server deployed on AWS instance

谁说我不能喝 提交于 2019-11-30 14:51:07
I have a shiny app that runs fine on my local machine in RStudio. I have launched an AWS EC2 Ubuntu instance and installed R and shiny-server on it. When I access the app via browser, the app crashes at a (seemingly) arbitrary point. Where can I access the R console log in order to be able to debug the code? There is no file in /var/log/shiny-server. Furthermore, the console in the browser simply states: The application unexpectedly exited. Diagnostic information is private. Please ask your system admin for permission if you need to check the R logs. I have tried working with options(shiny

Visual Studio 2015 diagnostic tools no longer working

旧街凉风 提交于 2019-11-30 06:26:40
I have Visual Studio 2015 Community Edition Update 3 running on Windows 7 SP1 64 bit, which I use to develop C# applications. I love the diagnostic tools during debugging to spot performance problems early on. However, they stopped working for me sometime in the last month or so (possibly related to installing Update 3, although I have no information to back that up). I see the error message "CPU Profiling while debugging is not available on this version of Windows. To see CPU usage details, run the CPU Usage tool without the debugger (Debug -> Performance Profiler...)." Things I have tried