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

Entire UNRST file is loaded into memory when only headers are asked for #1027

Open
berland opened this issue Nov 27, 2024 · 2 comments
Open
Assignees
Labels

Comments

@berland
Copy link
Contributor

berland commented Nov 27, 2024

In this code snippet:

def headers(self):
"""
Will return a list of the headers of all the keywords.
"""
header_list = []
for index in range(self.size):
kw = self[index]
header_list.append(kw.header)
return header_list

the entire contents of the UNRST file is loaded into memory.

On sufficiently big UNRST files, this will lead to an out-of-memory situation.

This bug is responsible for equinor/subscript#755

@berland
Copy link
Contributor Author

berland commented Nov 27, 2024

This can be seen by stepping through the code and checking that the kw object contains data for each cell in the model.

Seemingly garbage collection is insufficient to purge the loaded data for each loop invocation.

@berland berland added the bug label Nov 27, 2024
@berland berland added this to SCOUT Nov 27, 2024
@berland berland moved this to Todo in SCOUT Nov 27, 2024
@berland berland moved this from Todo to In Progress in SCOUT Nov 27, 2024
@berland berland self-assigned this Nov 27, 2024
@berland berland moved this from In Progress to Backlog in SCOUT Nov 27, 2024
@eivindjahren eivindjahren added the christmas-review Issues and PRs for Christmas review label Dec 13, 2024
@eivindjahren eivindjahren removed the christmas-review Issues and PRs for Christmas review label Dec 20, 2024
@berland
Copy link
Contributor Author

berland commented Dec 27, 2024

res2df has been ported to use resfo instead of this code, thus working around this limitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

2 participants