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

Reduce space used by OBO Parser #429

Merged
merged 5 commits into from
Aug 9, 2015
Merged

Conversation

sesuncedu
Copy link
Contributor

Implement memory saving techniques for oboformat objects. These changes help ameliorate the OOM issues involved in issue #426, but are not a complete fix, as the entire OBO document must be loaded into memory before conversion takes place.

Add freeze methods to oboformat Clause and Frame.
These methods:

  1. replace ArrayLists of size 0 with emptyList()
  2. replace ArrayLists of size 1 with singletonList()
  3. call trimToSize on ArrayLists of size >1.
    Any Modifications automatically thaw the relevant objects.

Add freezeFrames method to OBODoc, which will call freeze on all held frames.

Add string cache to OBOFormatParser. Limit cache capacity to 8M chars.
Freeze frames during parsing.

(a) replace ArrayLists of size 0 with emptyList()
(b) replace ArrayLists of size 1 with singletonList()
(c) call trimToSize on ArrayLists of size >1.
Modifications automatically the relevant objects.

Add freezeFrames method to OBODoc, which will call freeze on all held frames.
…o 8K chars.

Cached values are looked up in getParseUntil(String,boolean)

Call freeze on header frame, term frames, and typedef frames.
# Conflicts:
#	oboformat/src/main/java/org/obolibrary/oboformat/model/Clause.java
ignazio1977 added a commit that referenced this pull request Aug 9, 2015
Reduce space used by OBO Parser
@ignazio1977 ignazio1977 merged commit 0e05e31 into owlcs:version4 Aug 9, 2015
@sesuncedu sesuncedu deleted the owlapi-426 branch November 12, 2015 20:44
@sesuncedu sesuncedu restored the owlapi-426 branch January 6, 2016 21:40
@sesuncedu sesuncedu deleted the owlapi-426 branch December 2, 2016 21:03
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