The Hotspot compiler does not have an ExitOnOutOfMemoryError as the JRockit compiler does. You can simulate it on linux with something like what is below. We start with our test code that will ensure an out of memory condition… import…
Category: Development
Finding memory metrics in JBOSS
I can never remember how to do this, so this is just a placeholder for exposing memory utilization in JBOSS. c:\jboss-eap-5.1.2\jboss-eap-5.1\jboss-as\bin>twiddle.bat -u admin -p admin get jboss.system:type=ServerInfo | findstr Memory MaxMemory=3579183104 TotalMemory=3087007744 FreeMemory=2852457960 c:\jboss-eap-5.1.2\jboss-eap-5.1\jboss-as\bin>
ATG custom property descriptor to change data upon retrieving and persisting property
While coming up with a soon to be posted simple example of using the ATG stack to create an order, I found that using the encrypted credit number stored in the DPS_USER_CREDIT_CARD table was not usable upon checkout, as it…
Schema compare command line tool
I use what is below to quickly compare two Oracle database schema’s tables. It would be trivial to add indexes to the mix. import java.sql.*; import java.util.*; public class schemaDiffer { public static void main(String args[]) { try { Class.forName(“oracle.jdbc.driver.OracleDriver”);…
Print HTTP headers in ATG
ATG provides a class named InsertableServletImpl, which can do pretty much what it sounds like. You insert the servlet to be run in the ATG servlet pipeline where you dictate. This allows us to inject behavior into our application at…
Exhausting the heap on a JDBC batch with huge size
This is to be expected, but I had never seen it. I increased the batch size on a JDBC batch insert to 100,000 (yes, go ahead and laugh :)), and hit the exception below. As I noted, it makes sense,…
JDBC and Oracle Database Change Notification
Below is a simple example of a cutdown example of using DCN in Oracle with JDBC. I plan on presenting this to our developers as an alternative to the ATG InventoryCache manager module. import java.sql.*; import java.util.*; import oracle.jdbc.*; import…
Finding java thread consuming CPU
Periodically, we will have an application server go to 100% CPU utilization on a single java process. Below is the methodology I use to troubleshoot a high CPU thread consumer in java. 1. As the user running the Java Virtual…
awk script to print blocked threads in a java thread dump
-bash-4.1$ cat blocked_threads.awk #!/bin/awk -f { if ($0 ~ “- locked” || $0 ~ “- waiting to lock”) { s[i++]=$0 } } END { for (i in s) { if (s[i] ~ “waiting to lock”) { split(s[i],t) for (j in…
ApexSQL
We are currently migrating a given database environment from an external provider on SQL Server 2005 to Oracle 11.2.0.3. While we could use GoldenGate, it is a one time migration for which we don’t need the “big iron” (or cost).…