Q: why cant i increase my heap size? im using jdk 1.8.0_25 and im trying to work with a big database. it weights about 2gb.
i run the program trough eclipse.
i use 64bit java version on 64bit windows 7.
got 8gb ram.
everytime i try connectiong to it , i get java heap errors... so i tried increasing my heap size and i didnt make it!
visualVM says my max is still 2gb.
what i did was - control panel> programs > java > java > view.
ive added -Xmx6g parameter to my jdk (and im sure its the right jdk) but still nothing works.
any other suggestions on how to increase my heap size?
EDIT: 
here is the failing code line. just to make you guys sure that its not the code failing.
try {

        Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
        conn = DriverManager
                .getConnection("jdbc:ucanaccess://D:/Work/currentFolder/reallyBigDB.mdb");

conn = ...... is the failing line.

A: From Ucanaccess home page (first hit on Google).

When dealing with large databases and using the default memory
  settings (i.e., with Driver Property memory=true), it is recommended
  that users allocate sufficient memory to the JVM using the -Xms and
  -Xmx options. Otherwise it's needed to set Driver Property memory=false (Connection
  conn=DriverManager.getConnection("jdbc:ucanaccess://c:/pippo.mdb;memory=false");)

Now obviously you have another problem, the heap size. That's an eclipse issue. You could compile it in Eclipse and run it on the command line, giving the memory parameters there. That's at least a surefire way to make sure the parameters are correct.
Nevertheless, unless you absolutely have to load a huge chunk of data into memory, you usually don't want to. Luckily Ucanaccess has that parameter.

A: To increase the heap size of the JVM when using Eclispe:
Window -> Preferences -> Java ->Installed JRE
Then select the JRE you are using, and click Edit and enter the argument for the JVM in Default VM arguments
PS: As already mentioned in the comment section, you should not load the entire DB in memory, so it may be a better idea to review your code instead for increasing the heap

A: Other two parameters alternative to memory=false that may be useful are:
skipIndexes=true (it avoids memory occupation due to indexes that aren't integrity constraints)
Lobscale=1 if the db size is due to blob/ole data. In this specific case both the load time and the memory occupation will be drammatically reduced.
They have been both introduced with the 2.0.9.4.
