Skip to content

fix memory leak in allMarshal #12

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

Merged
merged 1 commit into from
Feb 14, 2023
Merged

fix memory leak in allMarshal #12

merged 1 commit into from
Feb 14, 2023

Conversation

paulfitz
Copy link
Member

Changes the implementation of allMarshal to follow closely the evolution of the implementation of all.

Adds a script that can be run as npm run test:memory to check for obvious memory leaks.

Prior to this fix, a typical run looked like (loop count, free memory):

                   0           8081154048
                1000           7443259392
                2000           6777753600
                3000           6128287744
                4000           5500166144
                5000           4849360896
                6000           4221939712
                7000           3558346752
                8000           2960449536
                9000           2309222400
               10000           1655738368
               11000           1019441152

After this fix, a typical run looks like:

                   0           8291295232
                1000           8268148736
                2000           8252329984
                3000           8253804544
                4000           8252588032
                5000           8261718016
                6000           8248782848
                7000           8268709888
                8000           8249749504
                9000           8258523136
               10000           8242008064
               11000           8255168512

Changes the implementation of `allMarshal` to follow closely the
evolution of the implementation of `all`.

Adds a script that can be run as `npm run test:memory` to check
for obvious memory leaks.

Prior to this fix, a typical run looked like:
```
                   0           8081154048
                1000           7443259392
                2000           6777753600
                3000           6128287744
                4000           5500166144
                5000           4849360896
                6000           4221939712
                7000           3558346752
                8000           2960449536
                9000           2309222400
               10000           1655738368
               11000           1019441152
```

After this fix, a typical run looks like:
```
                   0           8291295232
                1000           8268148736
                2000           8252329984
                3000           8253804544
                4000           8252588032
                5000           8261718016
                6000           8248782848
                7000           8268709888
                8000           8249749504
                9000           8258523136
               10000           8242008064
               11000           8255168512
```
Copy link
Member

@dsagal dsagal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this does the trick! Thanks for writing the test!

@paulfitz paulfitz merged commit d150b8a into grist-main Feb 14, 2023
@paulfitz paulfitz deleted the memory-fix branch February 14, 2023 17:02
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