Tuesday, October 30, 2012
Friday, October 26, 2012
Memory Leak Analyzer (Got java.lang.RuntimeException: java.lang.OutOfMemoryError: Java heap space)
One fine morning my client was asked me to develop an a small Framework as per his needs. And I started writing code in Java which drives lot of excel files , xmls etc. Due to emergency I delivered code to accomplish the immediate needs and knowing that it may have some memory leaks which I need to fix and which is my next immediate high priority one.
So I used MAT to find and analyze the code. And found it was really a cool plug-in.
1. How to install MAT plugin
Install plugin from - http://download.eclipse.org/mat/1.2/update-site/
2. MAT generates .hprof file , how to get it.
In Run-Configuration , under Argument tab in VM argument section added
-XX:+HeapDumpOnOutOfMemoryError
3. If .hprof file is too big?
Add -vmargs -XX:PermSize=256m -XX:MaxPermSize=256m -Xms256m -Xmx1024m into eclipse.ini
4.How to open .hprof in Eclipse.
Open MAT perspective , and File->Open Head Dump and Open .hprof generated in the project.
5.Analysis....
So I used MAT to find and analyze the code. And found it was really a cool plug-in.
1. How to install MAT plugin
Install plugin from - http://download.eclipse.org/mat/1.2/update-site/
2. MAT generates .hprof file , how to get it.
In Run-Configuration , under Argument tab in VM argument section added
-XX:+HeapDumpOnOutOfMemoryError
3. If .hprof file is too big?
Add -vmargs -XX:PermSize=256m -XX:MaxPermSize=256m -Xms256m -Xmx1024m into eclipse.ini
4.How to open .hprof in Eclipse.
Open MAT perspective , and File->Open Head Dump and Open .hprof generated in the project.
5.Analysis....
Tuesday, October 16, 2012
WebDriver - How to run tests on InternetExplorer
1. Download IEDriverServer from http://code.google.com/p/selenium/downloads/list
2.Create WebDriver instance as follows
WebDriver localDriver=;
capability.setCapability(CapabilityType.
SUPPORTS_JAVASCRIPT, true);
capability.setCapability(InternetExplorerDriver.
INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
try {
localDriver.setDriver(new RemoteWebDriver(new URL("http://127.0.0.1:5555"), capability));
localDriver.getDriver().manage().timeouts().implicitlyWait(30, TimeUnit.
catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
3. In your testcase method use localDriver
4. Run IEDriverServerxxx.exe
5. Run your tests.
2.Create WebDriver instance as follows
WebDriver localDriver=;
capability = DesiredCapabilities.internetExplorer();
capability.setJavascriptEnabled(true);
capability.setCapability(CapabilityType.
TAKES_SCREENSHOT, true);
capability.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);capability.setCapability(CapabilityType.
SUPPORTS_JAVASCRIPT, true);
capability.setCapability(InternetExplorerDriver.
INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
try {
localDriver.setDriver(new RemoteWebDriver(new URL("http://127.0.0.1:5555"), capability));
localDriver.getDriver().manage().timeouts().implicitlyWait(30, TimeUnit.
SECONDS);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
3. In your testcase method use localDriver
4. Run IEDriverServerxxx.exe
5. Run your tests.
Subscribe to:
Posts (Atom)