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

MORUS: do not needlessly allocate heap memory #2

Merged
merged 1 commit into from
Nov 29, 2022
Merged

MORUS: do not needlessly allocate heap memory #2

merged 1 commit into from
Nov 29, 2022

Conversation

lzaoral
Copy link
Contributor

@lzaoral lzaoral commented Nov 28, 2022

All arrays are, by default, allocated on the heap. Therefore, for every call of the morus_initialization method, a new set of constant arrays was allocated making the repeated initialisation not feasible, especially on cards with unreliable garbage collection.

Make these constant arrays class members instead so that they are allocated only once.

Detected-by: JCProfilerNext

Line chart depicting the repeated garbage collection on the NXP JCOP3 J3H145 card:

jcop3_MORUS_init

All arrays are, by default, allocated on the heap.  Therefore, for every
call of the morus_initialization method, a new set of constant arrays
was allocated making the repeated initialisation not feasible, especially
on cards with unreliable garbage collection.

Make these constant arrays class members instead so that they are allocated
only once.

Detected-by: JCProfilerNext
@MiragePV
Copy link
Collaborator

Hi, this project is discontinued and I won't be doing any more work on it.
If you wish to work on it yourself, please fork it to your own repo.

@MiragePV MiragePV merged commit 06227c2 into crocs-muni:master Nov 29, 2022
@lzaoral lzaoral deleted the mem-morus branch December 12, 2022 08:06
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