The maximum heap you allocate depends on the operating system, even the patches to the operating system, the amount of RAM and swap space available, and the other DLLs that are loaded into the JVMs address space.
For example, on a machine with 1GB RAM and 1GB swap space, you probably will not have enough free memory available to allocate 1.5GB.
Another example: I recall that a certain software registered a lot of performance statistics, so when I ran the JVM I saw a lot of that software's DLLs in the JVM address space. One way you can check what DLLs are loaded with your JVM is with the listdlls or Process Explorer tools from SysInternals. Look at where the DLLs are loaded into memory - the JVM always allocates the heap in one contiguous block so you can only allocate as much heap as the largest free memory block.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166473#4166473
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166473
Are you sure that you posted the correct code? I ask because the error message you posted is typically seen during an update, and not a query, and the code you posted relates to a query. (You really should have posted enough of the stack trace so that we could see a line that included the method in your code that initiated this.)
If it is this code, then the database is already corrupt. That is, the database already contains a duplicate key. In which case you will have to fix this using database tools.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166466#4166466
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166466