Skip to content
This repository was archived by the owner on Jun 18, 2020. It is now read-only.
This repository was archived by the owner on Jun 18, 2020. It is now read-only.

ExecutorCompletionService produces OOM #6

Description

@marcosnils

If consumers process slower than producers then you'll end up with a memory leak as ExecutorCompletionService created an unbounded LinkedBlockingQueue by default.

https://github.com/awslabs/dynamodb-import-export-tool/blob/623c333a7726cb80b01f2723a44a00951ec3cc64/src/main/java/com/amazonaws/dynamodb/bootstrap/BlockingQueueConsumer.java#L42

Also, the underlying ThreadPoolExecutor doesn't have a bounded blocking queue, which also causes OOM as infinite tasks can be scheduled into the executor:

https://github.com/awslabs/dynamodb-import-export-tool/blob/623c333a7726cb80b01f2723a44a00951ec3cc64/src/main/java/com/amazonaws/dynamodb/bootstrap/BlockingQueueConsumer.java#L41

Final question:

What's the purpose of having an ExecutorCompletionService here (https://github.com/awslabs/dynamodb-import-export-tool/blob/623c333a7726cb80b01f2723a44a00951ec3cc64/src/main/java/com/amazonaws/dynamodb/bootstrap/BlockingQueueConsumer.java#L42) if take or poll is never called?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions