Code Monkey home page Code Monkey logo

Comments (11)

davidegironi avatar davidegironi commented on May 12, 2024 2

I'm working on the net5 version. I think I will make a new branch. NET5 works, but I want to write the compiling script for dll and nuget package. I'm almost done with both, I think next week I'll have time to work on this.

from advanceddatagridview.

davidegironi avatar davidegironi commented on May 12, 2024 1

That's sound interesting, let me check it in the weekend. Meanwhile if you can check the nuget and _DevTools let me know.

from advanceddatagridview.

davidegironi avatar davidegironi commented on May 12, 2024 1

Hello @kirsan31
Thank you for your job,
I wasn't that much interested in the sample project FormMain investingation, but as you pointed out it turns out it has big memory leak.
In a few days I'll publish an update containing

  • net40 and net5.0 update
  • SDK solution format
  • leak fixed
  • MenuStrip new logic, with max checklist nodes enabler

It will be a major number update.
Up to my test all works. Here is the version I'll publish, If you want to check it out: https://file.io/NI8xeXxT2RVg
Next version will come out in a few weeks. I'll add the fix you suggested here: #60

from advanceddatagridview.

davidegironi avatar davidegironi commented on May 12, 2024

Hello @billpeet ,
unluckily I've no plan for .NET 5 or .NET Core, time to develop this open project is reduced. Also, up to now NET.5 is still RC, i think I will in the future skip .NET Core and go to .NET 5, when it will be stable. Of course hope I've time to perform this task.

from advanceddatagridview.

kirsan31 avatar kirsan31 commented on May 12, 2024

@davidegironi if your still interested, I made it here. And it's working at first look.

What done:

  • SDK projects format.
  • Multitargeting with net5.0-windows and net40.

What was not checked:

  • _DevTools dir.
  • NuGet stuff.

from advanceddatagridview.

davidegironi avatar davidegironi commented on May 12, 2024

Hello, check this out: https://www.file.io/download/lRRkuJowXmFN
Target net40 and net5.0-windows.
Updated the AutoBuild script and the NuGet builder, now both works (find AutoBuild updated version here: http://davidegironi.blogspot.com/2014/04/autobuild-is-build-automation-tool-for.html)
I've done my porting from nonSDK to SDK project, cause in your one there are a few things changed in the sln file also.
Check it out and let me know. Once you have done I'll post this no nuget, then I'll add the other changes requested here: #60

from advanceddatagridview.

kirsan31 avatar kirsan31 commented on May 12, 2024

Hi @davidegironi. Sorry I have very hard time at work for now. I will back as soon as I can.

from advanceddatagridview.

davidegironi avatar davidegironi commented on May 12, 2024

As a side note, if you want to check also the menustrip mod, you can find it here: #58 (comment)

This update contains the rewrite of the checklist filter logic, it's quite important. So It's better to check it a lot before publishing.

from advanceddatagridview.

kirsan31 avatar kirsan31 commented on May 12, 2024

@davidegironi

Hello, check this out: https://www.file.io/download/lRRkuJowXmFN

Hi, I looked at the code, and use .net5 version for some time and all seems ok (in terms of porting to .net5).

As a side note, if you want to check also the menustrip mod, you can find it here: #58 (comment)

File is not available any more.

P.s. While testing, I found some not serious memory problems in demo app and in lib too. But fixes are trivial. More serious problem is memory leak in ColumnHeaderCell :(
In OnColumnAdded we replace existing HeaderCell with our ColumnHeaderCell. So, in ColumnHeaderCell constructor we need to do a full clone of existing HeaderCell to dispose it after cloning. But this doesn't happens. Same in Clone method.
With current implementation we simple reference elements of old HeaderCell and this lead to impossibility of GC it.

In constructor we need to clone base DataGridViewColumnHeaderCell and if HeaderCell is ColumnHeaderCell clone new elements too (including MenuStrip).
This is not very trivial task and not possible without reflection (needed for cloning event handlers) :(

I'll be back as soon as I can (still troubles at work), hopefully in a few days.

from advanceddatagridview.

davidegironi avatar davidegironi commented on May 12, 2024

Thank you @kirsan31 .

You can find the file here: https://file.re/2021/04/19/advanceddatagridview/

About the Memory Leak, I've built after this issue #41 the "Memory Test" button.
I've checked it with net40, no problem at all. The behaviour under net5.0 indeed is different. This is a bit wired.
I thought

protected override void OnColumnRemoved(DataGridViewColumnEventArgs e)

should fix the problem but it's not like this.
I have to investigate on this. If you find a solution please share it with me, using the last code I send you. Thanks!

from advanceddatagridview.

kirsan31 avatar kirsan31 commented on May 12, 2024

@davidegironi Sorry, I haven't checked this yet :( Still have very little free time.
Demo app is leaking itself, net40 after 1 memory test:
image
I have fixed it here (with some small additional improvements).
Also some small memory fixes.

About huge memory leak on .Net5. The main problem of it I described in previous post. Now why on net4 we have only small leak and on .Net5 huge. This workaround:

protected override void OnHandleDestroyed(EventArgs e)
{
foreach (DataGridViewColumn column in Columns)
{
ColumnHeaderCell cell = column.HeaderCell as ColumnHeaderCell;
if (cell != null)
{
cell.SortChanged -= Cell_SortChanged;
cell.FilterChanged -= Cell_FilterChanged;
cell.FilterPopup -= Cell_FilterPopup;
MenuStrip menustrip = cell.MenuStrip;
menustrip.Dispose();
}
}
base.OnHandleDestroyed(e);
}

Not working on .Net5 because Columns already empty here. They are cleared here, with disposing of bindingSource_main.

We need properly dispose ColumnHeaderCell in OnColumnRemoved as your originally discuss. But the main problem prevent doing it. I will think of some workaround, because doing it right a bit challenging :)
Will be back as soon as I can.

----UPD----

It seems to me that the memory leak has been fixed. Your can check it here.

You can find the file here: https://file.re/2021/04/19/advanceddatagridview/

This file is gone too :( Why don't you just push a new branch?

from advanceddatagridview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.