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

How does fast_excel behave when an app error occurs? #68

Open
XenosRbel opened this issue Nov 2, 2020 · 1 comment
Open

How does fast_excel behave when an app error occurs? #68

XenosRbel opened this issue Nov 2, 2020 · 1 comment

Comments

@XenosRbel
Copy link

What happens to the memory allocated for an object when the option: constant_memory: true or false is set ? The file is not actually stored on disk If the file path is specified in initialize? With constant_memory true - meaning it is stored in RAM? In theory, stored data in an object (data table) should be cleared when an application error occurs.

def sample(file_path, collection)
  workbook = FastExcel.open(file_path, constant_memory: true)
  sheet = workbook.add_worksheet(self.class::MODEL_NAME)
  collection.each do |object|
      sheet.append_row(object)
  end

  raise StandartError
ensure
  #What does happens to the memory of the fast _excel object
end
@Paxa
Copy link
Owner

Paxa commented Feb 14, 2021

I think it may cause a memory leak, good catch!
PR is welcome

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

No branches or pull requests

2 participants