-
Notifications
You must be signed in to change notification settings - Fork 26
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
Memory Usage #40
Comments
It's probably related to this issue. |
@nthtran following on from discussion in that thread – the problem has to do with relay using the container component as a cache key, and since I thought I had solved this here tomconroy@d03e3a5 – this works, but it was problematic when the server was processing concurrent requests. @nthtran suggests we cache these QueryAggregator instances, keyed by the router location (?) |
My initial thought is after |
@nthtran Won't you run into the same problems as @tomconroy regarding concurrent requests if they happen to be for the same path? Isn't a unique I think the problem here is with the use of The star wars example in isomorophic-relay obviously avoids this problem because it is passing a constructor. Not sure how QueryAggregator could be made to work here... |
I've just pushed a fix for this issue. I believe the fix is solid, but if it doesn't work for you please tell. |
Looks like an AggregateContainer is cached per unique route, and is only caching the fragment information, so can safely be shared between "concurrent" users requesting the same unique path. The params are still unique per request and handled by QueryAggregator. That is an extremely clever solution. Nice! |
Hi @denvned, thanks for taking a look into this issue and for the project as a whole, it's been super helpful to us. Testing locally the new version it appears that the should we reopen this? |
@rodrigopr It would be strange if it really happens, because Still cache of |
Yes, but there might be multiple queries per route, that's why the |
@shalomvolchok Thank you for confirming! |
It seems that memory usage, in the example todo app of this repo, grows with every request. After about 5,000 request, on my local computer, the app consistently crashes with process out of memory.
The star wars example from isomorphic-relay doesn't seem to have this issue. After 25,000 requests memory usage was still consistent.
Am I missing something simple here? I know a lot of work was done to make Relay state contextual and it seems like that has all been finished.
I've attached two graphs from logging process.memoryUsage() on each request. The first (steady) graph is from isomorphic-relay and the second graph is from isomorphic-relay-router.
The text was updated successfully, but these errors were encountered: