DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

The Latest Performance Topics

article thumbnail
Java Performance Monitoring: 5 Open Source Tools You Should Know
Stagemonitor, Pinpoint, MoSKito, Glowroot, and Kamon are all promising open source Java monitoring tools. See where they can be best put to use.
January 19, 2017
by Henn Idan
· 92,842 Views · 39 Likes
article thumbnail
REST vs. TCP
With HTTP, each call is stateless and I can’t assume anything about the other side. With TCP, on the other hand, I can make a lot of assumptions about the conversation.
January 19, 2017
by Oren Eini
· 23,076 Views · 6 Likes
article thumbnail
Evicting Instances From Eureka
Spring Cloud Eureka's self-preservation tool is great for network problems, but it could keep your instances around when you don't want to. Fortunately, you can fix that.
January 10, 2017
by Ryan Baxter
· 9,530 Views · 2 Likes
article thumbnail
Gatling vs. JMeter
What's the max amount of threads you can run with each tool before you start getting errors or saturating a basic resource? Is there significantly different resource use?
January 10, 2017
by Federico Toledo
· 52,431 Views · 19 Likes
article thumbnail
An Introduction to Load Testing With Gatling
A new open source weapon for load testing has emerged, (Gatling) guns blazing!
Updated January 4, 2017
by Sree Tejaswi
· 29,517 Views · 22 Likes
article thumbnail
How to Resolve an SSL Handshake Error With Mule
With these tips, you should be good sending requests to your Mule application again.
January 1, 2017
by Akkiraju Ivaturi
· 15,795 Views · 1 Like
article thumbnail
Hacking the VPC: ELB as a Bastion
Keeping your cloud machine instances secure is of paramount importance, but it's often hard to troubleshoot and expensive. An Elastic Load Balancer can help with that.
December 26, 2016
by Keith Gregory
· 17,492 Views · 3 Likes
article thumbnail
Server Log Analysis: It's More Important Than Google Analytics
This article discusses the significance of analyzing the server logs. The author also demonstrates a server log dashboard created using the open source ELK Stack of Elasticsearch, Logstash, and Kibana.
December 23, 2016
by Samuel Scott
· 16,191 Views · 8 Likes
article thumbnail
A Deep Dive Into Couchbase N1QL Query Optimization
This comprehensive guide to N1QL queries covers the ins and outs of the query engine, teaching users about how to efficiently scan and join data.
December 16, 2016
by Keshav Murthy DZone Core CORE
· 16,893 Views · 9 Likes
article thumbnail
An Overview of Meta-Monitoring
Meta-monitoring is basically self-service for monitoring. There are several different requirements and methods that should be kept in mind when it comes to meta-monitoring.
December 15, 2016
by Thomas Kurian Theakanath
· 5,988 Views · 2 Likes
article thumbnail
Technical Spikes in DevOps
The true technical spike is a last resort and happens as infrequently as possible. It is a refinement activity that allows the backlog to be understood for future planning.
December 12, 2016
by $$anonymous$$
· 13,968 Views · 1 Like
article thumbnail
ConcurrentHashMap isn't always enough
When Java developers come to a task of writing a a new class which should have a Map datastructure field, accessed simultaneously by several threads, they usually try to solve the synchronization issues invloved in such a scenario by simply making the map an instance of ConcurrentHashMap . public class Foo { private Map theMap = new ConcurrentHashMap<>(); // the rest of the class goes here... } In many cases it works fine just because the contract of ConcurrentHashMap takes care of the potential synchronization issues related to reading/writing to the map. But there are cases where it's not enough, and a developer gets race conditions which are hard to predict, and even harder to find/debug and fix. Let's have a look, at the next example: public class Foo { private Map theMap = new ConcurrentHashMap<>(); public Object getOrCreate(String key) { Object value = theMap.get(key); if (value == null) { value = new Object(); theMap.put(key, value); } return value; } } Here we have a "simple" getter ( getOrCreate(String key) ), which gets a key and returns the value assosiated with the given key in theMap . If there is no mapping for the key, the method creates a new value, inserts it into theMap and returns it. So far so good. But what happens when 2 (or more) threads call the getter with the same key when there is no mapping for the key in theMap? In such a case we might receive a race condition: Suppose thread t1 enters the function and comes to line 7. Its value is null . At this point thread t2 enters the function and also comes to line 7. Its value is also obviously null . Therefore from this point the two threads will enter the if statement and execute lines 8 and 9, thus creating two different new Objects. Upon returning from the getter each thread will get a different Object instance, violating programmer's wrong assumption that by using ConcurrentHashMap "everything is synchronized" and therefore two different threads should get the same value for the same key. To solve this issue we can synchronize the entire method, thus making it atomic: public class Foo { private Map theMap = new ConcurrentHashMap<>(); public synchronized Object getOrCreate(String key) { Object value = theMap.get(key); if (value == null) { value = new Object(); theMap.put(key, value); } return value; } } But this is a bit ugly, and uses Foo instace's monitor, which may affect performance if there are other methods in this class which are synchronized. Also a common rule of thumb is to try to eliminate using synchronized methods as much as possible. A much better approach should be using Java 8 Map's computeIfAbsent(K key, Function mappingFunction), which, in ConcurrentHashMap's implementation runs atomically: public class Foo { private Map theMap = new ConcurrentHashMap<>(); public Object getOrCreate(String key) { return theMap.computeIfAbsent(key, k -> new Object()); } } The atomicity of computeIfAbsent(..) assures that only one new Object will be created and put into theMap, and it'll be the exact same instance of Object that will be returned to all threads calling the getOrCreate function. Here, not only the code is correct, it's also cleaner and much shorter. The point of this example was to introduce a common pitfall of blindly relying on ConcurrentHashMap as a majical synchronzed datastructure which is threadsafe and therefore should solve all our concurrency issues regarding multiple threads working on a shared Map. ConcurrentHashMap is, indeed, threadsafe. But it only means that all read/write operations on such map are internally synchronized. And sometimes it's just not enough for our concurrent environment needs, and we have to use some special treatment which will guarantee atomic execution. A good practice will be to use one of the atomic methods implemented by ConcurrentHashMap, i.e: computeIfAbsent(..), putIfAbsent(..), etc.
December 8, 2016
by Dima Leah
· 48,821 Views · 12 Likes
article thumbnail
Anomaly Detection Using H2O Deep Learning
In this article, we jump straight into creating an anomaly detection model using Deep Learning and anomaly package from H2O.
December 6, 2016
by Sibanjan Das
· 25,783 Views · 7 Likes
article thumbnail
Camel and Kura: Providing Telemetry Data as OPC UA
If you're using an industrial M2M protocol, consider the combined power of Camel and Kura to get your telemetry data squared away as OPC UA.
November 29, 2016
by Jens Reimann
· 6,072 Views · 3 Likes
article thumbnail
Working With Time-series Data on Redshift
Working with data ordered in time has some unique challenges that we should take into consideration when we design our data warehouse solution.
November 23, 2016
by George Psistakis
· 8,609 Views · 3 Likes
article thumbnail
5 Exceptional Regression Testing Tools
Open-source tools are free, but we need to look at the bigger picture. Check out this list of five regression testing automation tools for enterprises.
November 22, 2016
by Pratik Satasiya
· 50,824 Views · 9 Likes
article thumbnail
7 Tips for Writing Better Unit Tests in Java
Want to write better unit tests in Java? Look no further. From test-driven development to measuring code coverage, here are seven tips to get the job done.
November 21, 2016
by Reshma Bidikar
· 177,224 Views · 29 Likes
article thumbnail
How to Improve Page Load Speed with SVG Optimization
This article will show you what to remove from your SVGs to stop them from slowing down your page and giving your end user a poor experience.
November 20, 2016
by Kyle Henwood
· 23,228 Views · 1 Like
article thumbnail
Lambda Architecture with Apache Spark
A lot of players on the market have built successful MapReduce workflows to daily process terabytes of historical data. But who wants to wait 24h to get updated analytics?
November 3, 2016
by Taras Matyashovskyy
· 76,900 Views · 30 Likes
article thumbnail
Divide and Conquer: High Scalability With MongoDB Sharding
MongoDB handles horizontal scaling via sharding. Take a look at the different sharding methods you can use and how to make them work.
November 1, 2016
by Eugen Hoble
· 37,422 Views · 3 Likes
  • Previous
  • ...
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • ...
  • Next
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook
×