-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
[Question] Memory leak in Join method #87
Comments
Maybe related to #84 ? |
Yep, I thought about it, but I'm not sure. Anyway, please, fix this ASAP :)) Thank you! |
Please test latest NuGet version1.0.7.3 |
Thank you, I've tested it now. Now it soo much better, but still leaks: 1 iteration = 0.95 sec (fantastic!) Well, here in every iteration I work wit exactly the same classes, that connected together through lots of JOINs, it's all the same, but I change just a condition of WHERE statement from iteration to iteration. Hope, this will help. |
Can you add this example project on github? That makes it easier for me to analyse and debug. |
The problem is that it's not an example project, I tell you timers from real app and it uses big data with lot's of JOINS, and of course, I can't upload it. But ok, I'll try to make some demo test for this case |
Hi! I've made some demo, try to download source from my repo on github, dunno if I done everything right. There is a simple console app, and you could see the growth of time and memory :) Looking forward to your answer! |
Are you sure you have tested the latest version : 1.0.7.3 ? Because when I run your example, I see this:
|
Ok... very strange, on 1.0.7.3 it really works. I'll check this on a real project today and let you know how it goes |
Ok, finally I got it :) Try out my last commit, but not sure that you'll think it's a bug :) The problem was that I've generated random names every time for same types - I mean different names for inner and outter fields. And everytime of course you can't find it in your cache dictionary, you save new record. If it's possible to fix - that'll be cool. |
I will check your project. However you can also fork this project and make a pull request on my source code : MemoryLeakTest project in scr-console folder. |
Ok, will do |
I did quickly check your test code. See this example:
The code above creates 2 different types. System.Linq.Dynamic.Core will do the same, except it's dynamic. |
Yep, that's why I said that probably it's not a bug. But actually I can use same type in different parts of program, use different names and get this memory leak. And it's not a good idea. Maybe will be better to remove this string name from dictionary's key? Just leave only type names? |
This sounds possible, I will take a look at the code and do some tests. |
Sorry, this is not possible. Because the dynamic generated types do not only define the |
Just for test take first test method (Join()), and run it several times (10 000, 100 000, etc.), like this. And every next iteration will take a little bit longer to pass through + we'll get memory leaks. For example, first time it will take about 00:00:00.003, And on 12000 iteration it will take 00:00:00.101 already. On iteration 27400 it will take 00:00:00.214 and so on..
But it's on a small data. In a real project (in my case), for example every next Join gets about 5sec longer:
1 iteration = 3.7 sec
2 iteration = 8 sec
3 iteration = 13 sec
4 iteration = 19 sec.
And now it's a critical bug for me. I think that there is some problems with static cache.
The text was updated successfully, but these errors were encountered: