一段时间后,C#windows应用程序挂起 [英] C# windows application hang after some time

查看:78
本文介绍了一段时间后,C#windows应用程序挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Hi,

my windows application hang after some time 



i我正在使用外部DLL和在application.on按钮中执行该DLL操作单击我执行DLL操作。但经过三次四次点击申请后挂起。



我的代码是




i am using External DLL and perform that dll operation in application.on button click i perform dll operation. but after three four click application hangs.

my code is

private Thread objnewth;





on timer tick



on timer tick

if (objnewth == null || !objnewth.IsAlive)
                {
                    objnewth = new Thread(new ThreadStart(objmain.backgroundprocess));
                    objnewth.IsBackground = true;
                    objnewth.Priority = ThreadPriority.Highest;
                    objnewth.Start();
                    //backgroundprocess();
                    BtnStartStop.Text = "Count:-" + theCount;
                    timer1.Stop();
                    timer1.Start();
                }

推荐答案

外部dll存在问题。可能存在内存泄漏或其他问题(连接等)。

程序挂起后检查CPU和内存使用情况。



检查供应商的文档,以确保您将正确的数据集传递给他们。

还检查他们是否有一些硬件限制(操作系统支持/ RAM要求)。
There is a problem with the external dll. There could be memory leaks or other issues (connectivity etc.)
Check your CPU and memory usage after the program hangs.

Check the vendor's documentation to make sure you are passing the right set of data to them.
Also check if they have some hardware restrictions (OS support / RAM requirements) on their end.

这篇关于一段时间后,C#windows应用程序挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆