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

OutOfMemoryError: Requested array size exceeds VM limit #5

Open
Seanalair opened this issue Feb 17, 2016 · 2 comments
Open

OutOfMemoryError: Requested array size exceeds VM limit #5

Seanalair opened this issue Feb 17, 2016 · 2 comments
Labels

Comments

@Seanalair
Copy link

I get the following error whenever I try to run generate-database.sh with my own fonts in the fonts folder (or even with certain subsets of the provided fonts, such as KhmerOS.ttf on its own):

Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit
    at com.google.typography.font.sfntly.data.MemoryByteArray.<init>(Unknown Source)
    at com.google.typography.font.sfntly.data.WritableFontData.createWritableFontData(Unknown Source)
    at com.google.typography.font.sfntly.Font$Builder.loadTableData(Unknown Source)
    at com.google.typography.font.sfntly.Font$Builder.loadFont(Unknown Source)
    at com.google.typography.font.sfntly.Font$Builder.getOTFBuilder(Unknown Source)
    at com.google.typography.font.sfntly.FontFactory.loadSingleOTFForBuilding(Unknown Source)
    at com.google.typography.font.sfntly.FontFactory.loadSingleOTF(Unknown Source)
    at com.google.typography.font.sfntly.FontFactory.loadFonts(Unknown Source)
    at fr.free.nrw.DatabaseGenerator.fontHasCharacter(DatabaseGenerator.java:148)
    at fr.free.nrw.DatabaseGenerator.generate(DatabaseGenerator.java:71)
    at fr.free.nrw.DatabaseGenerator.main(DatabaseGenerator.java:170)

I have tried editing the script to allocate more memory for java (using -Xmx2048m), but it doesn't resolve the issue. Thanks in advance for your help!

@nicolas-raoul
Copy link
Owner

Thanks for the report!
So, the same problem happens even with only KhmerOS.ttf? Do I understand correctly?
What is your java version and operating system? How much RAM do you have?

@Seanalair
Copy link
Author

That's correct, the problem can be reproduced by removing the other two fonts from the font folder. My version was Java 8 Update 60, but your question prompted me to check for updates and download the latest version (Java 8 Update 73). The problem persists on this version as well. I'm using a Macbook Pro running El Capitan with 16GB RAM.

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

No branches or pull requests

2 participants