rynop / dynamodb-local

A wrapper for AWS DynamoDB Local, intended for use in testcases
MIT License
52 stars 30 forks source link

Increasing Heap Size #7

Closed rickwaugh1 closed 5 years ago

rickwaugh1 commented 9 years ago

I'm running out of memory running dynamoDB locally. I have been trying to increase the heap size on startup, like this:

DynamoDbLocal.launch(8000, null, ['-sharedDb','-Xms4096m','-Xmx8192m'])

But either I'm using a ridiculous amount of memory, or it's not working. Should the above work?

rickwaugh1 commented 9 years ago

So here's the problem. As it stands, the args passed in in that array are placed at the end of the java command. But those needed to alter the heap size need to come immediately after the java command.

This does not work: java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -port 8000 -sharedDb -Xms1024m -Xmx2048m

This works: java -Xms1024m -Xmx2048m -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -port 8000 -sharedDb

pickworth commented 5 years ago

@rickwaugh1 My PR resolves this problem.

Until it gets merged, you can use my fork.

npm install nmors/dynamodb-local#add-support-for-java-options

await DynamoDbLocal.launch(
        8000, 
        null, 
        [], 
        true, 
        true,
        '-Xms1024m -Xmx2048m'
);