Giter Site home page Giter Site logo

memory leak?? about secs4net HOT 37 CLOSED

mkjeff avatar mkjeff commented on July 20, 2024
memory leak??

from secs4net.

Comments (37)

TiltonJH avatar TiltonJH commented on July 20, 2024 3

@Gavenvincent You are welcome to try https://github.com/TiltonJH/secs4net. I fixed the leak there. I also created a pull request, but mkjeff does not seam to be interested in it.

from secs4net.

TiltonJH avatar TiltonJH commented on July 20, 2024 2

No it is not normal. the reason are the not reused or disposed SocketAsyncEventArgs. I fixed it. I am preparing to a pull request.

from secs4net.

TiltonJH avatar TiltonJH commented on July 20, 2024 2

I have created the promised pull request to fix the memory leak (and other issues) #35

One can also see the code here: https://github.com/TiltonJH/secs4net

from secs4net.

TiltonJH avatar TiltonJH commented on July 20, 2024 2

The reason are the not reused or disposed SocketAsyncEventArgs as described here: SocketAsyncEventArgs Class#Remarks

I also fixed an issue where messages went missing, because only the first message was read from the buffer.

from secs4net.

dzhydaniel avatar dzhydaniel commented on July 20, 2024 1

let's keep post Q&A here.

from secs4net.

Gavenvincent avatar Gavenvincent commented on July 20, 2024 1

The same thing happened to me,There's going to be a memory leak every time when click the send button.
Steps to reproduce the behavior:
1.Start two instances
2. Connection successful
3. passive form send messages to the active form,and successfully
4. Then,there's going to be a memory leak every time when click the send button.

from secs4net.

0daycrack avatar 0daycrack commented on July 20, 2024 1

@TiltonJH HI,Thanks~
This problem is caused by my UI!

from secs4net.

tazu08408 avatar tazu08408 commented on July 20, 2024

Thank you!
I want to use the improved software.
I am waiting to be merged.

from secs4net.

dzhydaniel avatar dzhydaniel commented on July 20, 2024

@tazu08408 do you have any progress of this project ? can you run EAP Host?

from secs4net.

tazu08408 avatar tazu08408 commented on July 20, 2024

@dzhydaniel
No, there is no progress on this project.
A memory leak occurred in the development of an application using this library.
Check the operation on the EAP host.
Are there any results that do not cause memory leaks?

from secs4net.

dzhydaniel avatar dzhydaniel commented on July 20, 2024

@tazu08408 did you can run MWN01 or PEU01? i can't, this has bugging me for a very long time.

from secs4net.

dzhydaniel avatar dzhydaniel commented on July 20, 2024

@tazu08408 @TiltonJH hi guys do you have the intreast of start a group on we chat

from secs4net.

tazu08408 avatar tazu08408 commented on July 20, 2024

@dzhydaniel
I would like to actively discuss SECS communications.
The platform to discuss may be any SNS.

from secs4net.

tazu08408 avatar tazu08408 commented on July 20, 2024

@dzhydaniel
MWN01 and PEU01 are not used.
It uses only the SECS communication function and uses the original wrapper library based on SECS4NET.
We are developing communication software for semiconductor devices.

from secs4net.

dzhydaniel avatar dzhydaniel commented on July 20, 2024

@dzhydaniel
I would like to actively discuss SECS communications.
The platform to discuss may be any SNS.

seems only two of us are active offtenly.

from secs4net.

tazu08408 avatar tazu08408 commented on July 20, 2024

Do you discuss here?
There is a possibility that others will cooperate.

from secs4net.

tazu08408 avatar tazu08408 commented on July 20, 2024

What are the challenges with SECS4NET?
I have problems with memory leaks and I have not been able to identify the cause either in SECS4NET or my own library.

from secs4net.

dzhydaniel avatar dzhydaniel commented on July 20, 2024

I have not run into memory leak problem yet, right now i am trying to set auto reply mechanism, and try to figure out how to define message,how to update item value in one message.

from secs4net.

TiltonJH avatar TiltonJH commented on July 20, 2024

Hi,

in order for the pull request, I need to solve a Git problem. I cloned this repository to our on site TFS. I am still new to Git and can not figure out how to create the pull request from our master on the on site TFS to this repository on GitHub. Can someone help me or give me a push in the direction of the solution?

from secs4net.

Metetron avatar Metetron commented on July 20, 2024

Hi,

I am also no git master, but i think one of the easiest solutions would be to clone the repository from the tfs to your local machine and change the remote to the github address and then create the pull request.

The command for doing this should look like this:
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git

from secs4net.

dzhydaniel avatar dzhydaniel commented on July 20, 2024

@TiltonJH how to contact you besides this frum

from secs4net.

TiltonJH avatar TiltonJH commented on July 20, 2024

@dzhydaniel Contact me? To what end?

from secs4net.

dzhydaniel avatar dzhydaniel commented on July 20, 2024

@TiltonJH my company need secs/gem solution, it appears you have alot know-how and technical skills, i think may be my company and you can work together .

from secs4net.

TiltonJH avatar TiltonJH commented on July 20, 2024

@dzhydaniel thx, but I am germany based and currently working for a company which sells a product which uses secs4net. Maybe this could be your secs/gem solution. Have a look at www.inqu.de. especially for our InQu.MDA.

from secs4net.

Gavenvincent avatar Gavenvincent commented on July 20, 2024

@TiltonJH That's really awesome.I will try and I would like to know where exactly is mkJeff's memory leak ,then do some detailed memory analyses.

from secs4net.

Gavenvincent avatar Gavenvincent commented on July 20, 2024

@TiltonJH Thank you very much ! I'll start with that.

from secs4net.

0daycrack avatar 0daycrack commented on July 20, 2024

@TiltonJH I hava tried your https://github.com/TiltonJH/secs4net ,but there's still going to be a memory leak every time when click the send button.How can i fix it?
Thank you~

from secs4net.

TiltonJH avatar TiltonJH commented on July 20, 2024

@0daycrack Any more information on that? How do you arrive at this conclusion?
I could not find a leak in all my extensive tests.

from secs4net.

0daycrack avatar 0daycrack commented on July 20, 2024

@TiltonJH Hi, I use a timer to cycle send messages,
The following are my codes:

①Button Click
        private  void btnSendPrimary_Click(object sender, EventArgs e)
        {
            timer1.Interval = 10;
            timer1.Enabled = true;
        }
②Timer Event
        private async void timer1_Tick(object sender, EventArgs e)
        {
            if (_secsGem.State != ConnectionState.Selected)
                return;
            if (string.IsNullOrWhiteSpace(txtSendPrimary.Text))
                return;
            try
            {
                var reply = await _secsGem.SendAsync(txtSendPrimary.Text.ToSecsMessage());
                txtRecvSecondary.Text = reply.ToSml();
            }
            catch (SecsException ex)
            {
                txtRecvSecondary.Text = ex.Message;
            }
        }

The following are my steps:
1.Start two instances
2. Connection successful
3. passive form send messages to the active form,and successfully
4. Then,there's going to be a memory leak
Meixin20200616143303

from secs4net.

TiltonJH avatar TiltonJH commented on July 20, 2024

@0daycrack Hi, So you lock at the memory allocation and it steadily grows?

You could use Visual Studio Diagnostic Tools to analyze your memory with memory snapshots (while debugging) and determine what kind of object or objects remain. Once that is done and it is actually a object from within secs4net. I can take a look where that object is used and where it is kept and for what purpose. And then fix the issue.

It could also be possible that it is not sec4net, but your UI that keeps things referenced and thereby keep the GC from collecting it.

from secs4net.

YandaLiang avatar YandaLiang commented on July 20, 2024

@TiltonJH Hi,I have tried your https://github.com/TiltonJH/secs4net, It has solved the memory leak problem, but I have found another problem:
The reconnection problem occurs After frequently disconnecting the device when the program is running in Active mode。

from secs4net.

teonsen avatar teonsen commented on July 20, 2024

@TiltonJH is awesome! but I faced the same issue on reconnecting at active mode just like @YandaLiang said.
It seems to be the async task is not canceled when Retry. This ends up "Connection Exhaust" easily.
I upload the fixed version here. (it's only a sample. never tested.)
https://github.com/teonsen/secs4net/tree/dev

hope this helps.

from secs4net.

TiltonJH avatar TiltonJH commented on July 20, 2024

@teonsen Great! If someone tests this and I'll get a pull request I will merge this.

@YandaLiang BTW: Shouldn't this be filed under a different issue?

from secs4net.

freesiafreesia avatar freesiafreesia commented on July 20, 2024

I also fixed an issue where messages went missing, because only the first message was read from the buffer.

@TiltonJH Hi, Could you tell me which commit did you fix this issue in your pull request #35?

from secs4net.

Gavenvincent avatar Gavenvincent commented on July 20, 2024

@TiltonJH
HSMS BUG 20210602
A new bug was recently discovered using your project,it is:
1.Start two instances
2. Connection successful
3. But it quickly becomes buggy

from secs4net.

TiltonJH avatar TiltonJH commented on July 20, 2024

Well, yes I have noticed that too. However, I currently don't have the time to investigate or fix it.

If someone would provide a fix (pull request) for it, I would take a look and integrate it.

from secs4net.

mkjeff avatar mkjeff commented on July 20, 2024

the memory usage is a big target on the v2 roadmap. welcome to test v2

from secs4net.

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.