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

There is insufficient memory for the Java Runtime Environment to continue. #37

Closed
casolorz opened this issue Nov 29, 2018 · 9 comments
Closed

Comments

@casolorz
Copy link

casolorz commented Nov 29, 2018

Describe the bug
A clear and concise description of what the bug is.

Bundletool version(s) affected
Version: [e.g. 0.3.3] 0.7.1

Stacktrace

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/home/carlos/Downloads/bundletool-all-0.7.1.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000625a00000, 1065353216, 0) failed; error='Not enough space' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 1065353216 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /home/carlos/Downloads/hs_err_pid22129.log

To Reproduce
Seems to happen sometimes when running bundletool to generate the signed apks.

Expected behavior
Create the signed apks without the crash.

Environment:
OS: [e.g. iOS 10.3.3]
Ubuntu 18.10

I can attach the hs file it generated but I edited it to remove private parts of my command line.

@casolorz
Copy link
Author

hs_err_pid22129.log

Forgot the attachment.

@casolorz
Copy link
Author

Using -Xmx5G on the command line helped but it froze my computer for a long time. Don't know that 5G was needed, just what I tried the first time.

@plecesne
Copy link
Contributor

What is the command you run? Any sample we can reproduce on?

@casolorz
Copy link
Author

This is the command that worked

java -Xmx5G -jar bundletool-all-0.7.1.jar build-apks --bundle=../..../app.aab --output=bundleapks.apks --ks=../..../keystore --ks-pass=pass:..... --ks-key-alias=.... --key-pass=pass:....

Without -Xmx5G then it has the issue.

I can share the aab file if you give me an email to share it with, don't want to upload it here.

@plecesne
Copy link
Contributor

plecesne commented Nov 30, 2018

How big is the Bundle and how big is the APK Set?

As a short-term workaround, you could possibly try reducing the parallelism using --max-threads=1 or 2.

@casolorz
Copy link
Author

aab file is 29 megs.

Where do I use --num-threads=1 at? on which part of the command line?

@plecesne
Copy link
Contributor

Sorry, --max-threads, in the build-apks command.

@casolorz
Copy link
Author

Same issue with --max-threads=1

It happens pretty quickly when trying it with that aab.

@plecesne
Copy link
Contributor

I recommend to build only the APKs for the device you want to test it on. You can do so by passing a device spec to the command (through the --device-spec flag).

The device spec file can be generated manually or bundletool also provides a command (get-device-spec) to extract the spec from a connected device. See this documentation.

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