GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bucket api using a lot of memory due to retry-request · Issue #1392 · googleapis/google-cloud-node

bucket api using a lot of memory due to retry-request #1392

New issue
Copy link
New issue
Copy link
Closed
Closed
bucket api using a lot of memory due to retry-request#1392
Copy link
Assignees
stephenplusplus
Labels
coretype: questionRequest for information or clarification. Not an issue.

Description

@richtera
richtera
opened on Jun 24, 2016
Issue body actions

Since the bucket api is using the retry-request module it's growing my node heap to around 7G due to large files being up and downloaded. Node is not willing to give up all that memory right away. Since I really don't need retry for such large requests and would rather know when an error happens due to rate restrictions is there a way to turn of the usage of retry-request?
Thanks
Andy

Activity

Next
  1. stephenplusplus commented on Jun 24, 2016

    @stephenplusplus
    stephenplusplus
    on Jun 24, 2016
    Contributor
    More actions

    You can disable the retries by providing { maxRetries: 0 } to Storage:

    var gcs = gcloud.storage({ maxRetries: 0 });

    Let me know if that helps.

  2. stephenplusplus
    added
    type: questionRequest for information or clarification. Not an issue.
    core
    on Jun 24, 2016
  3. richtera commented on Jun 24, 2016

    @richtera
    richtera
    on Jun 24, 2016
    Author
    More actions

    That will prevent a retry, but I need it to revert to using a plain request rather than a retry-request. The retry-request will pipe all of the request and response data into a streamcache which is what's taking up all the memory. I need to be able to disable caching of the stream data in memory.
    Thanks
    Andy

  4. stephenplusplus commented on Jun 24, 2016

    @stephenplusplus
    stephenplusplus
    on Jun 24, 2016
    Contributor
    More actions

    Ah, I see. I didn't realize stream-cache was keeping that in memory indefinitely. I'll see if I can think of something to release those after we don't need the cache stream anymore.

  5. richtera commented on Jun 24, 2016

    @richtera
    richtera
    on Jun 24, 2016
    Author
    More actions

    It's not indefinitely and does get eventually released but node does not free up the underlying OS memory for quite a while and maybe never. And for large files I would rather have it fail than clobbering memory to this extent.
    More detail... I think the file object will keep the streamCache in scope. I had to refactor to have the file object go out of scope before the heapdump showed the memory released.
    Thanks
    Andy

  6. stephenplusplus commented on Jun 24, 2016

    @stephenplusplus
    stephenplusplus
    on Jun 24, 2016
    Contributor
    More actions

    I would guess the buffers a stream-cache instance retains go out of scope when the stream itself goes out of scope. But I think we could try only retaining that data until we pipe a single stream to it.

    In other words, I believe stream-cache now is holding internally all of the data it receives, because it thinks we want to replay them to possibly multiple streams. I think we should modify it to stop holding data internally after it has already had a stream connected to it. I'll put this into code and see if this works. Hope you won't mind if I ping you to try it out!

  7. stephenplusplus commented on Jun 24, 2016

    @stephenplusplus
    stephenplusplus
    on Jun 24, 2016
    Contributor
    More actions

    @richtera I made a branch of retry-request that removes stream-cache completely, instead just using a normal passthrough stream to hold data. Can you see if it improves the memory usage in your project?

    $ npm install --save stephenplusplus/retry-request#rm-stream-cache
  8. richtera commented on Jun 27, 2016

    @richtera
    richtera
    on Jun 27, 2016
    Author
    More actions

    Works great. My memory footprint went from 7G to 700M :). Sorry it took a couple of days to validate.
    Thanks.
    Andy

    Reacted by Dave
  9. stephenplusplus commented on Jun 27, 2016

    @stephenplusplus
    stephenplusplus
    on Jun 27, 2016
    Contributor
    More actions

    Great! Thanks for catching this, it's going to be very appreciated by our users :) I'm going to run it through a few more tests, then merge and release 👍

  10. stephenplusplus
    added
    enhancement
    on Jun 27, 2016
  11. stephenplusplus commented on Jun 27, 2016

    @stephenplusplus
    stephenplusplus
    on Jun 27, 2016
    Contributor
    More actions

    Released the fix in retry-request under 1.3.1. gcloud will automatically pick it up in new installs. Thanks again!

  12. stephenplusplus
    closed this as completedon Jun 27, 2016
  13. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  14. sofisl
    added a commit that references this issue on Jan 27, 2026

    chore(deps): update actions/checkout action to v3 (#1392) (#814)

    dfeb1c0
  15. 22 remaining items

  16. sofisl
    added 2 commits that reference this issue on Feb 26, 2026

    fix: reset buffered chunked value before retry (#1397)

    This issue will close once commit 50e7d64 is merged into the 'main' branch.
    50e7d64

    chore: release 5.9.2 (#1406)

    This issue will close once commit 180abce is merged into the 'main' branch.
    180abce
  17. codyoss
    added 3 commits that reference this issue on Mar 5, 2026

    chore(deps): update actions/checkout action to v3 (#1392) (#292)

    8a2577f

    chore(deps): update actions/checkout action to v3 (#1392) (#317)

    3cb9af8

    chore(deps): update actions/checkout action to v3 (#1392) (#317)

    c71b412
  18. GautamSharda
    added a commit that references this issue on Mar 11, 2026

    chore(deps): update actions/checkout action to v3 (#1392) (#1511)

    5c3eeb8
  19. codyoss
    added a commit that references this issue on Mar 12, 2026

    chore(deps): update actions/checkout action to v3 (#1392) (#208)

    69d6886
  20. GautamSharda
    added 3 commits that reference this issue on Mar 12, 2026

    chore(deps): update actions/checkout action to v3 (#1392) (#296)

    2d5f212

    chore(deps): update actions/checkout action to v3 (#1392) (#296)

    151e021

    chore(deps): update actions/checkout action to v3 (#1392) (#739)

    56afcd9
  21. thiyaguk09
    added a commit that references this issue on Mar 18, 2026

    chore(deps): update actions/checkout action to v3 (googleapis#1392) (g…

    d96e99b
  22. GautamSharda
    added 2 commits that reference this issue on Mar 23, 2026

    chore(deps): update actions/checkout action to v3 (#1392) (#1066)

    5007278

    chore(deps): update actions/checkout action to v3 (#1392) (#1066)

    c980a13
  23. shivanee-p
    added a commit that references this issue on Mar 27, 2026

    chore(deps): update actions/checkout action to v3 (#1392) (#1066)

    1db2bef
  24. thiyaguk09
    added a commit that references this issue on May 5, 2026

    chore(deps): update actions/checkout action to v3 (googleapis#1392) (g…

    32c0eac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

coretype: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.