Skip to content

Conversation

dkimitsa
Copy link
Contributor

As a fix of #150
It doesn't fix memory consumption but make life of GC a bit easier as millions of strings are not being constructed.

Changes

Compiler produces LLVM IR .ll file from Java class file. It's a text file and compiler converts instructions into strings and concatenates everything into one big text file. During operation, it produces thousands of string and glues them together.
All these strings in results are being written into destination byte buffer using Writer.
Optimization here is to make all entities to write itself directly to Writer instead of producing intermediate strings.

Compiler produces LLVM IR `.ll` file from Java class file. It's a text file and compiler converts instructions into strings and concatenates everything into one big text file. During operation, it produces thousands of string and glues them together. There was a [case]({{ site.baseurl }}{% post_url 2020-05-25-fix-oom-big-classes %}) recently when 4GB string was tried to be built.
All these strings in results are being written into destination byte buffer using `Writer`.
Optimization here is to make all entities to write itself directly to `Writer` instead of producing strings.
@dkimitsa dkimitsa mentioned this pull request Apr 24, 2022
# Conflicts:
#	compiler/compiler/src/main/java/org/robovm/compiler/llvm/StructureConstant.java
@Tom-Ski Tom-Ski merged commit 031c503 into MobiVM:master Jun 11, 2022
@dkimitsa dkimitsa deleted the fix/momory-usage-vol2 branch June 12, 2022 13:45
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

Successfully merging this pull request may close these issues.

2 participants