Welcome!

Java IoT Authors: Mehdi Daoudi, Pat Romanski, Stackify Blog, Elizabeth White, Liz McMillan

Related Topics: Java IoT

Java IoT: Blog Post

Java Profilers: Three Types and Why You Need All of Them | @CloudExpo #Java #Cloud

Debugging performance issues in production can be a pain and in some cases impossible without the right tools

Java Profilers: Three Types and Why You Need All of Them
By Darin Howard

Debugging performance issues in production can be a pain and in some cases impossible without the right tools. Java profilers have been around forever, but the profilers most developers think about are only one type.

Lets dive into the three different kinds of Java profilers:

  1. Standard JVM Profilers that track every detail of the JVM (CPU, thread, memory, garbage collection, etc).
  2. Lightweight profilers that highlight your application with a bit of abstraction.
  3. Application Performance Management (APM) tools used for monitoring applications live in production environments.

Standard JVM profilers
Products like VisualVM, JProfiler, YourKit and Java Mission Control.

Standard profilers certainly provide the most data, but not necessarily the most usable information. This depends on the type of debugging task. These profilers will track all method calls and memory usage. This allows a developer to dive into the call structure at whatever angle they choose.

Pros:

  • Great for tracking down memory leaks, standard profilers detail out all memory usage by the JVM and which classes/objects are responsible.  The ability to manually run garbage collection and then review memory consumption can easily shine a spotlight on classes and processes that are holding on to memory in error.
  • Good for tracking CPU usage, profilers usually provide a CPU sampling feature to track and aggregate CPU time by class and method to help zero in on hot spots.

Cons:

  • Requires a direct connection to the monitored JVM, this ends up limiting usage to development environments in most cases. (Note: some profilers can work off thread and memory dumps in a limited fashion)
  • They slow down your application; a good deal of processing power is required for the high level of detail provided.

Lightweight Java transaction profilers

Products like XRebel and Stackify Prefix.

Lightweight profilers take a different approach at tracking your application by injecting themselves right into code.

  • Aspect Profilers use aspect oriented programming (AOP) to inject code into the start and end of specified methods. The injected code can start a timer and then report the elapsed time when the method finishes. These profilers are simple to setup but you need to know what to profile. For an example see Spring AOP Method Profiling.
  • Java Agent profilers use the Java Instrumentation API to inject code into your application. This method has greater access to your application since the code is being rewritten at the bytecode level. This allows for any code running in your application to be instrumented - be it code you wrote or 3rd party libraries your application depends on. Check out Introduction to Java Agents to see how this all works.

Aspect profilers are pretty easy to setup but are limited in what they can monitor and are encumbered by detailing out everything you want tracked.  Java Agents have a big advantage in their tracking depth, but are much more complicated to write.

Stackify Prefix is a developer oriented profiler using the Java Agent profiler method behind the scenes. The cool thing is that Prefix already knows the most desired classes and 3rd party libraries developers want instrumented - so you don't have to detail them all out. Plus it takes all the stats from the instrumentation and displays them in simple and understable manner. As an example when running an application using Hibernate, Prefix will not only detail out the elapsed time for queries,  but displays parameter values for the generated SQL. When your app calls to a SOAP/REST API, Prefix provides the request and response content.

Java profiler prefix example

Prefix Screenshot: Tomcat Web Request Trace

Low overhead, Java JVM profiling in production (APM)

APM tools like New Relic, AppDynamics, Stackify Retrace, Dynatrace.

All the profilers so far have been great for development, but tracking how you system performs in production is critical. Production is always a different landscape - development and staging setups typically don't have the same datasets and load.

Java APM tools typically use the Java Agent profiler method but with different instrumentation rules to allow them to run without affecting production performance. The trick with these profilers is to provide the right information in a smart way to not take up CPU cycles.

Stackify Retrace is an APM tool that uses the same tech as Stackify Prefix with a few adjustments to run smoothly in staging and production environments. This is done by  aggregating timing statistics and sampling traces. This gives you method level visibility to your applications code that is running production. So when you have a slow web request, that will translate into a trace showing up in Retrace. From there you can dive in and see what methods are the culprit.

java profiler performance aggregation

Retrace Screenshot: Web Request Aggregation over 4 hours

java profiling tomcat trace

Retrace Screenshot: Tomcat Web Request Trace

Why are some Java Profilers so expensive?

XRebel is a cool tool, but it costs $365 a year. Stackify Prefix is free and provides much of the same functionality

The biggest problem with APM solutions is definitely their pricing. They have traditionally been so expensive that only the largest enterprises could afford them. It doesn't make a lot of sense to spend $100 a month on a server at Azure or AWS and then spend another $200 a month for a product like New Relic.

Monitoring tools shouldn't cost more than the servers!

The post Java Profilers: 3 types and why you need all of them appeared first on Stackify.

Read the original blog entry...

More Stories By Stackify Blog

Stackify offers the only developers-friendly solution that fully integrates error and log management with application performance monitoring and management. Allowing you to easily isolate issues, identify what needs to be fixed quicker and focus your efforts – Support less, Code more. Stackify provides software developers, operations and support managers with an innovative cloud based solution that gives them DevOps insight and allows them to monitor, detect and resolve application issues before they affect the business to ensure a better end user experience. Start your free trial now stackify.com

@ThingsExpo Stories
When shopping for a new data processing platform for IoT solutions, many development teams want to be able to test-drive options before making a choice. Yet when evaluating an IoT solution, it’s simply not feasible to do so at scale with physical devices. Building a sensor simulator is the next best choice; however, generating a realistic simulation at very high TPS with ease of configurability is a formidable challenge. When dealing with multiple application or transport protocols, you would be...
An increasing number of companies are creating products that combine data with analytical capabilities. Running interactive queries on Big Data requires complex architectures to store and query data effectively, typically involving data streams, an choosing efficient file format/database and multiple independent systems that are tied together through custom-engineered pipelines. In his session at @BigDataExpo at @ThingsExpo, Tomer Levi, a senior software engineer at Intel’s Advanced Analytics ...
Internet-of-Things discussions can end up either going down the consumer gadget rabbit hole or focused on the sort of data logging that industrial manufacturers have been doing forever. However, in fact, companies today are already using IoT data both to optimize their operational technology and to improve the experience of customer interactions in novel ways. In his session at @ThingsExpo, Gordon Haff, Red Hat Technology Evangelist, shared examples from a wide range of industries – including en...
Detecting internal user threats in the Big Data eco-system is challenging and cumbersome. Many organizations monitor internal usage of the Big Data eco-system using a set of alerts. This is not a scalable process given the increase in the number of alerts with the accelerating growth in data volume and user base. Organizations are increasingly leveraging machine learning to monitor only those data elements that are sensitive and critical, autonomously establish monitoring policies, and to detect...
"We're a cybersecurity firm that specializes in engineering security solutions both at the software and hardware level. Security cannot be an after-the-fact afterthought, which is what it's become," stated Richard Blech, Chief Executive Officer at Secure Channels, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA.
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. Jack Norris reviews best practices to show how companies develop, deploy, and dynamically update these applications and how this data-first...
Intelligent Automation is now one of the key business imperatives for CIOs and CISOs impacting all areas of business today. In his session at 21st Cloud Expo, Brian Boeggeman, VP Alliances & Partnerships at Ayehu, will talk about how business value is created and delivered through intelligent automation to today’s enterprises. The open ecosystem platform approach toward Intelligent Automation that Ayehu delivers to the market is core to enabling the creation of the self-driving enterprise.
The question before companies today is not whether to become intelligent, it’s a question of how and how fast. The key is to adopt and deploy an intelligent application strategy while simultaneously preparing to scale that intelligence. In her session at 21st Cloud Expo, Sangeeta Chakraborty, Chief Customer Officer at Ayasdi, will provide a tactical framework to become a truly intelligent enterprise, including how to identify the right applications for AI, how to build a Center of Excellence to ...
SYS-CON Events announced today that Massive Networks will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Massive Networks mission is simple. To help your business operate seamlessly with fast, reliable, and secure internet and network solutions. Improve your customer's experience with outstanding connections to your cloud.
Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution and join Akvelon expert and IoT industry leader, Sergey Grebnov, in his session at @ThingsExpo, for an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
Because IoT devices are deployed in mission-critical environments more than ever before, it’s increasingly imperative they be truly smart. IoT sensors simply stockpiling data isn’t useful. IoT must be artificially and naturally intelligent in order to provide more value In his session at @ThingsExpo, John Crupi, Vice President and Engineering System Architect at Greenwave Systems, will discuss how IoT artificial intelligence (AI) can be carried out via edge analytics and machine learning techn...
SYS-CON Events announced today that Datera, that offers a radically new data management architecture, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Datera is transforming the traditional datacenter model through modern cloud simplicity. The technology industry is at another major inflection point. The rise of mobile, the Internet of Things, data storage and Big...
Consumers increasingly expect their electronic "things" to be connected to smart phones, tablets and the Internet. When that thing happens to be a medical device, the risks and benefits of connectivity must be carefully weighed. Once the decision is made that connecting the device is beneficial, medical device manufacturers must design their products to maintain patient safety and prevent compromised personal health information in the face of cybersecurity threats. In his session at @ThingsExpo...
In his session at @ThingsExpo, Arvind Radhakrishnen discussed how IoT offers new business models in banking and financial services organizations with the capability to revolutionize products, payments, channels, business processes and asset management built on strong architectural foundation. The following topics were covered: How IoT stands to impact various business parameters including customer experience, cost and risk management within BFS organizations.
SYS-CON Events announced today that CA Technologies has been named "Platinum Sponsor" of SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business - from apparel to energy - is being rewritten by software. From planning to development to management to security, CA creates software that fuels transformation for companies in the applic...
From 2013, NTT Communications has been providing cPaaS service, SkyWay. Its customer’s expectations for leveraging WebRTC technology are not only typical real-time communication use cases such as Web conference, remote education, but also IoT use cases such as remote camera monitoring, smart-glass, and robotic. Because of this, NTT Communications has numerous IoT business use-cases that its customers are developing on top of PaaS. WebRTC will lead IoT businesses to be more innovative and address...
SYS-CON Events announced today that App2Cloud will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct. 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. App2Cloud is an online Platform, specializing in migrating legacy applications to any Cloud Providers (AWS, Azure, Google Cloud).
Recently, IoT seems emerging as a solution vehicle for data analytics on real-world scenarios from setting a room temperature setting to predicting a component failure of an aircraft. Compared with developing an application or deploying a cloud service, is an IoT solution unique? If so, how? How does a typical IoT solution architecture consist? And what are the essential components and how are they relevant to each other? How does the security play out? What are the best practices in formulating...
SYS-CON Events announced today that MobiDev, a client-oriented software development company, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MobiDev is a software company that develops and delivers turn-key mobile apps, websites, web services, and complex software systems for startups and enterprises. Since 2009 it has grown from a small group of passionate engineers and business...
Internet of @ThingsExpo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 21st Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal and enterprise IT since the creation of the Worldwide Web more than 20 years ago. All major researchers estimate there will be tens of billions devic...