Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out-of-memory exception with restricted memory and large artifact size #181

Closed
pdrd opened this issue Apr 6, 2022 · 2 comments
Closed

Comments

@pdrd
Copy link

pdrd commented Apr 6, 2022

Describe the bug
Download of a large artifact (1 GB) from a connector with a restricted memory limit (2 GB) can lead to an Out-Of-Memory exception. A test with a 100 MB file succeeded.

To Reproduce

  1. Restrict memory limit of connector to 1-2GB
  2. Add a new artifact with data size of 1GB+, e.g. https://speed.hetzner.de/1GB.bin
  3. Trying to download the artifact will result in Internal Server Error 500
  4. Logs contain OOM-Exception

Expected behavior
The available memory should not restrict the maximum size of a file. It seems like the file might be fully cached in the dsc and then forwarded to the client. This should be done with appropiate chunk sizes/buffers to avoid OOM problems, otherwise the request of multiple big files in parallel might always be problematic - even on machines with more memory.

Logs

2022-04-06T08:54:03,029 [scheduling-1] �[32mINFO�[m - Scanning agreements...
2022-04-06T08:55:04,588 [http-nio-8080-exec-9] �[32mINFO�[m - Sending request to https://speed.hetzner.de/1GB.bin ...
2022-04-06T08:55:04,688 [http-nio-8080-exec-9] �[32mINFO�[m - Successfully received response to request.

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "mssql-jdbc-TimeoutPoller"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Catalina-utility-2"

Exception in thread "http-nio-8080-Poller" java.lang.OutOfMemoryError: Java heap space
Exception in thread "Catalina-utility-1" java.lang.OutOfMemoryError: Java heap space
2022-04-06T08:55:20,047 [http-nio-8080-exec-9] �[31mERROR�[m - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed  nested exception is java.lang.OutOfMemoryError: Java heap space] with root cause
java.lang.OutOfMemoryError: Java heap space
@tmberthold
Copy link

Duplicate of #27 ?

@tmberthold
Copy link

will close it since it's a duplicate, linked this issue in the other for more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants