Skip to content

VisualVM – Remote Java Processes

June 16, 2017

VisualVM is pretty straight forward for the local java processes.

If you have a remote java process where you want to view the permgen, number of classes loaded, profiling (Remote Profiling is available only for the processes using JDK 1.8), jstatd comes for the rescue

Two steps to follow

  1. Instantiate jstatd
    1. Create a policy file (eg., – jstatd.policy)
      grant codebase “file:<path to jdk>/lib/tools.jar” {
    2. Start the jstatd
      ./jstatd -p <PORT NUMBER><PATH TO>/jstat.policy -J-Djava.rmi.server.hostname=<SERVER IP> -J-Djava.rmi.server.logCalls=true
  2. Connect the local VisualVM to the remote jstatd process using the <PORT NUMBER> given above



Banking Concepts / Law at a Glance – Part A

July 6, 2016

Let’s see some acronyms and other details pertaining to Banking concepts / law

  • BSBDA – Basic Savings Bank Deposit Accounts
  • KYC – Know your Customer
  • Scheduled Bank – Bank which is listed in the 2nd Schedule of RBI Act, 1934
  • Savings Account – Useful for investment/savings
  • Current Account – Useful for Business (Overdraft facility – Subject to the bank’s approval)
  • Fixed Deposits – Term deposits which attract more interest rates than a Savings Account (Usually for a term. e.g. 6 months, 1 year and so on)
  • Recurring Deposits – Accumulate money over a period of time and get better rate of interest
  • NIA – Negotiable Instruments Act, 1881
    • Inchoate instrument – Unrecorded Instrument
    • Indorsement – Simple method of signing the instrument in favour of a third person and delivering the instrument
    • Drawer – Maker of the instrument
    • BOE – Bill of Exchange
    • Cheque – A bill of exchange drawn on a specified banker and not expressed to be payable otherwise than on demand
    • Promissory Note – An instrument in writing containing an unconditional undertaking, signed by the maker, to pay a certain sum of money only to, or to the order of a certain person or to the bearer of the instrument
  • NBFC – Non-Banking Financial Company
  • Securitization Act, 2002
    • SPV – Special Purpose Vehicle
  • CRR – Credit Reserve Ratio – Certain proportion of the deposits in form of cash
  • SLR – Statutory Liquidity Ratio – Reserve a commercial bank has to maintain before providing credit
  • Repo Rate – Rate at which RBI lends to Commercial banks (Short-term)
  • Reverse Repo Rate – Rate at which RBI gives Interest to the Commercial banks on their deposits
  • Lien – A legal claim against an asset which is used to secure a loan
  • NEFT – National Electronics Funds Transfer
  • RTGS – Real-time gross settlement systems
  • IMPS – Immediate Payment Service
  • NPCI – National Payments Corporation of India
  • NACH – National Automated Clearing House
  • Clearing House – A banker’s established where the bills and cheques from member banks are exchanged
  • RuPay – A new card system launched by NPCI

Platform – Development

July 5, 2016


Read the following article –

Interesting, Java tops the Chart!!!

Though there are several theories on best programming languages, personally i feel, it all depends on the team. What they are good at – what they have been using?

Have worked with teams using Java, PHP, .NET, C/C++, Jython. Few years back, we did multiple PoCs for shortlisting the stack for development. After few weeks of study, it boiled down to the existing platform.

We can add new frameworks and tools, but changing the platform altogether is a game changer and it needs lot of effort and conviction.

Few pointers to shortlist a platform for development

  1. Team
  2. Platform – Ecosystem

It is not only the developing the application / framework or others. It boils down to the productivity and sustenance.

These rankings also influence the availability of programmers in the market.

Over a period of time, every development team needs to reinvent the way they work. Look into the new set of tools which can boost their productivity and remove unwanted code.





On Cloud [0-9]

January 7, 2016


Pretty much excited to start a not for profit activity which would be helpful to everyone !!!

There are certain things which will give you satisfaction to the core and i believe we got this idea while driving [?] (Thanks to the Bangalore traffic – Don’t blame the Bangalore traffic, we don’t know,  it can spark the next big idea)

Stay tuned for the updates.


Picture Courtesy –

Labour Laws in India

January 2, 2016

To understand the Labour Laws in India one has to go through (The given list is incomplete)

  • Industrial Disputes Act, 1947
  • Trade Unions Act, 1926
  • Workmen’s Compensation Act, 1923
  • Factories Act, 1948
  • Minimum Wages Act, 1948
  • Employees State Insurance Act, 1948
  • Payment of Wages Act, 1965
  • Payment of Bonus Act, 1965
  • Payment of Gratuity Act, 1972
  • Maternity Benefit Act, 1961
  • Industrial Employment (Standing Orders) Act, 1946
  • Employees Provident Fund and Miscellaneous Provisions Act, 1952
  • Mines Act, 1952
  • Equal Remuneration Act, 1976
  • Employers Liability Act, 1938
  • Apprentices Act, 1961
  • Child Labour (Prohibition and Regulation) Act, 1986

The are other specific acts for Beedi Workers, Cine Workers, Building & Construction workers, Plantation Labours, Journalists / Newspaper Employees etc.,

The amount of thought and the work which has gone inside framing all these is mind boggling!



Map – Java, Scala, Ruby

December 25, 2015

names =

startTime =

(0..200000).each do |i|
#puts “adding #{i} to the list.”
# pushes the i variable on the *end* of the list
names[i] = “Jagan”+i.to_s

names.each_pair {|key,value| puts “#{key} = #{value}”}
endTime =

p startTime
p endTime



package com.jasokan.test;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;

public class TestMap {

public static void main(String[] args) {
Map<Integer, String> nameMap = new HashMap<Integer, String>();

Calendar startTime = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(“HH:mm:ss”);

for (int i = 0; i < 200000; i++) {
nameMap.put(new Integer(i), “Jagan” + i);

for (Integer name : nameMap.keySet()) {

String key = name.toString();
String value = nameMap.get(name).toString();
System.out.println(key + ” ” + value);


Calendar endTime = Calendar.getInstance();




import java.util.Calendar

object TestMap {
def main(args: Array[String]) {

var names: Map[Int, String] = Map()

val startTime = Calendar.getInstance().getTime()

for (i <- 1 to 200000) {
names += (i -> (“Jagan” + i.toString()));

names.keys.foreach { i =>
print(“Key = ” + i)
println(” Value = ” + names(i))

val endTime = Calendar.getInstance().getTime()



Run the programs to get the time taken 🙂

But an interesting problem to observe

Please watch the Creation and printing of Map in Scala!




Concurrent calls to an API using Ruby

December 18, 2015

Got an interesting problem

  1. We need to read a csv file in chunks
  2. Process the chunk of data (transformation)
  3. Once the data is transformed, call the URLs concurrently

This is to avoid the sequential operation. For example, you have a REST API by which you update the address of the employees.

The addresses are going to be different and their details as well (employee id and others)

The bottleneck will be the database which can be handled by throttling the count of concurrent calls.

There are two gems which came handy to solve this problem

  1. Typhoeus
  2. Smarter CSV

Code sample

Reading the csv file in chunks

options = {:chunk_size => 30}
n = SmarterCSV.process(file_name, options) do |chunk|
process(chunk, otherArguments)

Creating the chunk requests

def process(chunk,otherArguments)
urlArray =
chunk.each do |row|
request_body_map = {
:test => row[:test]
urlArray << row[:test].to_s + request_body_map.to_json
callConcurrent(urlArray, url)

Calling the requests Concurrently

def callConcurrent(requestDetails, url)
bodyString = “”
hydra =
requestDetails.each do|website|
request =
method: :put,
body: bodyString
request.on_complete do |response|
p request + ” === ” + response.code.to_s;


There is a significant improvement in processing the data. Identify the load and tweak the chunk count and you will be able to achieve better performance.