Saturday, September 16, 2017

Basics of Java Garbage Collection

It’s an old joke from the time when Java was new and slow compared to other languages. Over time, Java became a lot faster. Today it powers many real-time applications with hundreds of thousands of concurrent users. These days, the biggest impact on Java’s performance comes from its garbage collection. Fortunately, in many cases, it can be tweaked and optimized to improve performance.

For most applications, the default settings of the JVM work fine. But when you start noticing performance issues caused by garbage collection and giving more heap memory isn’t possible, you need to tune and optimize the garbage collection. For most developers, it’s a chore. It requires patience, good knowledge garbage collection works and an understanding of application’s behavior. This post is a high-level overview of Java’s garbage collection with some examples of troubleshooting performance issues.

Continue reading here

Thursday, August 24, 2017

TLS 1.0 has been disabled - Salesforce

First things first: What's TLS and why did Salesforce moved to 1.x and had to disable TLS 1.0?

TLS 1.0

What kind of improvements brings to the table TLS 1.1?

  1. Added protection against cipher-block chaining (CBC) attacks.
  2. Support for IANA registration of parameters.
Clearly TLS 1.1 is more secure (compared to 1.0).

The things that can be affected in your instances are as below:

  • Web requests to Salesforce URLs that require authentication. 
  • Web requests to the login page of a My Domain.
  • Web requests to Community or sites.
  • Web requests to Customer and Partner portals.
  • Web to lead, web to case, and web to custom object requests API requests to Salesforce Callouts using Apex to a remote endpoint.
  • Workflow outbound messaging callouts to a remote endpoint Callouts using Lightning Connect to a remote endpoint AJAX proxy callouts to a remote endpoint.
  • Delegated authentication callouts to a remote endpoint Mobile apps developed with Salesforce Mobile SDK need to upgraded to SDK v4.

That's a big list and if you are an enterprise org, then I am sure you would have at least one of the above things in your org and you may find it to be broken if you don't take any action.

So below are some of the suggestions to fix this issue:
  • If you are using migration tool and ANT process be on a latest ANT version. 
  • If you are using Java 7, upgrade to Java 8 since Java 8 by default uses 1.2
  • If have an integration running, like WebMethods, there will be setting to disable TLS 1.0 or to enable TLS 1.2 (see -Dhttps.protocols=TLSv1.1,TLSv1.2). 
  • You can disable TLS 1.0 in your browser, but I'd rather upgrade :) 
  • Also look for specific configuration if you want to explicitly force tools to use TLS 1.1 or TLS 1.2

Hopefully this sheds some light and helps you reduce the pain of dealing with this.