Not sure if relevant, but when I had a similar issue, I could solve it with by increasing the java heap size:
options(java.parameters = "-Xmx16g")
Note that you have to place it at the beginning of your code, restart your session and run this line before loading packages.