Archivos por Etiqueta: jvm

IPv6: How to disable

Aqui un chuletario de como deshabilitar el Stack IPv6 en diferentes sistemas (Windows, Linux y Java)

En Linux hay varios metodos diferentes:

1) Agregando al cmdline del kernel el parametro:

ipv6.disable=1

2) Usando el sysctl (proc):

net.ipv6.conf.all.disable_ipv6=1

3) Forzando el modprobe.conf:

alias net-pf-10 off
alias ipv6 off
install ipv6 /bin/true

En Windows 7 solo hay que cambiar una clave del registro:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters]
"DisabledComponents"=dword:000fffff

En Java se puede definir una System property para que use IPv4 de modo preferente:

-Djava.net.preferIPv4Stack=true         # por defecto es false
-Djava.net.preferIPv6Addresses=false    # opcional: por defecto false

Referencias:
Windows: KB-929852
Windows: How-To disable IPv6
Linux: ipv6 module options
Linux: ip-sysctl
Linux: man 5 modprobe.conf
Java: IPv6 guide

Anuncios

Java: How check if JVM is 64bits?

A veces es util saber si estas corriendo una JVM de 32 o 64 bits.

public class Check64bitsJVM {
	public static void main(final String[] args) throws Throwable {
		System.out.println("JVM is 64bits?: " + JVMis64bits());
	}
	public static boolean JVMis64bits() {
		final String propOsArch = System.getProperty("os.arch");
		final String propSunDataModel = System.getProperty("sun.arch.data.model");
		System.out.println("os.arch: " + propOsArch);
		System.out.println("sun.arch.data.model: " + propSunDataModel);
		// 
		if (propSunDataModel != null) {
			return propSunDataModel.equals("64");
		}
		if (propOsArch != null) {
			return propOsArch.contains("64");
		}
		return false;
	}
}

Leer más de esta entrada

JVM performance optimization – Java

Java applications run on the JVM, but what do you know about JVM technology?

If you are a programmer then you have undoubtedly experienced that special feeling when a light goes on in your thought process, when those neurons finally make a connection, and you open your previous thought pattern to a new perspective.

All JVM implementations have one thing in common, which is their attempt to get application bytecode translated into machine instructions. Some JVMs interpret application code on load and use performance counters to focus on “hot” code. Some JVMs skip interpretation and rely on compilation alone. The resource intensiveness of compilation can be a bigger hit (especially for client-side applications) but it also enables more advanced optimizations.

Read complete articles:
JVM performance optimization, Part 1: A JVM technology primer.
JVM performance optimization, Part 2: Compilers.

A %d blogueros les gusta esto: