We are facing a performance issue once the Java Swing application is moved from Java 6 32 bit to Java 7 32 bit update 11. Can anyone provide some clue on this ?
The application is using Java Web-start technology and the server is Tomcat 7. The client application is consuming 1GB of memory, so the screen is freezing out.
We are exchanging serialized objects, following is the code:
Object object = connection.sendCommand(command); // exchanging serialized object
public class ConnectionImpl implements Connection {
public Object sendCommand(Command command) throws Exception {
URL url = new URL(System.getProperty("serverUrl"));
URLConnection connection = url.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setUseCaches(false);
oos = new ObjectOutputStream(new BufferedOutputStream(connection
.getOutputStream()));
oos.writeObject(command);
oos.flush();
InputStream inputStream = connection.getInputStream();
ZipInputStream zip = new ZipInputStream(inputStream);
if (zip.getNextEntry() != null) {
ois = new ObjectInputStream(zip);
object = ois.readObject();
}
zip.close();
}
}
// The serialized class
public class CommandImpl implements Command, Serializable {
private String serviceName;
private String methodName;
private Map<String, Object> parameterMap;
// followed by getter & setters
}
- Client Machine: Windows 7 32 bit, Java 7 update 11 32 bit
- Server Machine: Windows 64 bit 2008 R2 Enterprise Server, Java 7 update 11 64 bit
There is no change in the code only the JVM is updated.
I have taken the memory snapshot for JDK 1.6 and JDK 1.7 using Java VisualVM, following is the link to rar file which contains the snapshots:
Memory Snapshots using Java VisualVM Heap Dump using Java VisualVM
The NetBeans IDE provides an option to migrate the code from Java 6 to Java 7. Following is the link regarding this:
https://netbeans.org/kb/docs/java/editor-inspect-transform.html#convert
Will it be a good option for migrating the entire source code from Java 6 to Java 7 without any issue? Or anyone feels that it might create some issue ? And if we do so, whether we can solve this performance issue up-to some extend?