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

calling require inside a mehtod is causing memory bloat if this method is called multiple times. #99

Closed
asivasub14 opened this issue May 15, 2023 · 4 comments · Fixed by #102
Assignees

Comments

@asivasub14
Copy link
Contributor

asivasub14 commented May 15, 2023

require 'rgl/adjacency'

Image from our calling the bfs_search_tree_from method internally through the RGL directed graph is indicating high memory for the require, is it possible to remove it and do once when this file is loaded?
image

@monora
Copy link
Owner

monora commented May 16, 2023

That is bad news. Since I do not want to require rgl/adjacency unconditionally: Can you check if this would solve the problem:

unless defined?(DirectedAdjacencyGraph)
  require 'rgl/adjyceny'
end

Even better, you could do a PR with these changes.

@asivasub14
Copy link
Contributor Author

Sure, will test this and submit a PR. Just out of curiosity why we do not want to require unconditionally?

@monora
Copy link
Owner

monora commented May 16, 2023

I want to minimize dependencies. Only this method of the modul needs adjacency.

@monora
Copy link
Owner

monora commented May 23, 2023

Fixed by PR #100

@monora monora closed this as completed May 23, 2023
@monora monora reopened this Jun 7, 2023
@monora monora self-assigned this Jun 17, 2023
@monora monora linked a pull request Jun 17, 2023 that will close this issue
@monora monora closed this as completed in 54f92e4 Jun 17, 2023
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 a pull request may close this issue.

2 participants