jonschlinkert / delete-empty

Recursively delete all empty folders in a directory and child directories.
MIT License
42 stars 10 forks source link

Consumes a lot of memory #15

Closed eight04 closed 3 years ago

eight04 commented 4 years ago

image Why does it use so many resources for a simple task?

eight04 commented 4 years ago

I decided to kill the process after it grew to 750 mb. image

doowb commented 4 years ago

Can you show some code on how you're using delete-empty and also, if you're specifying a large directory of files/folder or one that is deeply nested, there could be a lot of memory usage.

eight04 commented 4 years ago

I'm using the CLI in a large folder by running delete-empty .

I guess it may be better if we can

  1. Avoid collecting all empty folders in the empty array
  2. Switch to opendir API.

Is that an option for this project?

jonschlinkert commented 3 years ago

Closing since this library was refactored and this may no longer be applicable.