I am using the DNP driver of ScadaLTS, but enabling the datasource, I am having 100% peak of cpu in java. Has anyone ever had anything like it and if so, have you solved it?
Related
I support an older Lotus Notes application that uses ODBC to connect to Oracle for reading and writing purposes. Each of the connection objects are being set to Nothing when their routine is complete, but, for some reason, Domino will not drop the connections. This causes us to have to reboot the Domino server that application resides on every day. Sometimes, once a day is not enough to keep the program from grinding to a near standstill. Does anyone have any ideas how to get those connections to drop when the script is done processing?
MJ
It turns out that the ODBC class has a disconnect method. Who knew? Sorry to waste everyones's time. I put in the disconnect and problem was solved. Not sure why I never noticed it before. Anyway, thanks for the replies.
MJ
I am writing an Ethernet driver. I would like to do it in 2 steps:
write it without DMA (simple memcpy)
rewrite it using DMA.
I would like to ask if it is possible to do it first without using DMA (or is it that the kernel Ethernet framework insist that the driver shall use DMA)?
Kernel's not stopping you from doing anything. But specifically, I can't see it stopping you from writing skbuffs, nor mapping the device memory.
Honestly you might have most difficulty if you want to find examples of network driver code that doesn't use DMA. If I understand correctly, even Linux netpoll (for crash logging over network) doesn't avoid DMA in the drivers.
I wasn't sure memcpy() would work though...
You need to read your docs (e.g. and specifically). Looks like you need to use memcpy_fromio() and memcpy_toio() on IO memory.
We have a small (for now) Asp.Net MVC 5 website on a dedicated VPS. When I go to the server and fire-up task manager, I see that "SQL Server Windows NT - 64 bit" is using around 80% of CPU and 170MB of RAM and IIS is using 6% CPU and 400MB of RAM. Server Specs are:
CPU 1.90Ghz dual core
Memory 2GB
Windows Server 2012
SQL Server Express 2012
Disk Space: 25GB, 2.35 Free.
The database is not very big. Its backup is less than 10MB.
I have tried to optimize the website as much as I could. I added caching to a lot of controllers and implemented donut caching for quite a lot of controllers. But today, even though there were only 5 users online, our search wouldn't work. I restarted the Windows on the server and it started working but I got the high CPU usage the minute server started. Interestingly when I open the SQL Server Management Studio and try to get the report for top CPU-consuming queries it says that there are no queries currently consuming any CPU!!! But at the same time I can see that SQL server is consuming a lot of CPU. How can I examine what is taking all the CPU? Below is a picture from the server:
I was/am very careful with designing and implementing the website. All the database access is through latest version of Entity Framework. I just wonder if the server's specs are low. Any help would be very much appreciated.
Update:
Here's the result of the sp_who2 stored procedure.
This could happen if the memory set to use is more than the available memory on the box. The default memory setting of 2147483647MB. In our case the AWS box had only 30.5 GB so we changed the setting to 26GB and the CPU usage fell to 40%. You generally want to leave 20% of memory for OS and its operations.
I would agree running SQL Profiler to spot large query durations and large write operations. Try running perfmon and spotting any potential connection leaks (reclaimed connections).
i'd like to use the mysql odbc driver for connecting to my mysql database via my own app.
the problem is that it seems very unstable - i keep getting errors like:
[MySQL][ODBC 5.1 Driver][mysqld-5.5.8]MySQL server has gone away
it seems to be something like a session timeout.
so here's my questions:
- what is causing those errors?
- is there a way to fix it for getting stable connections?
- is it recommended at all using it for coding windows software?
thanks
My guess is you're opening the connection once and leaving it open. At some point, the connection either times out, or some network hiccup is causing the connection to be invalid/closed. The best way to do database access is to open the connection when you need to do work, then close it. Or, alternatively, change your code to support re-connecting when you encounter an error.
Based on discussion in the comments below, I would suggest dumping the access database to a csv file, then using something like PHPMySql to import the data into MySQL.
You can use the BigDump tool to import large databases dumps into MySQL. (via this site)
There are commercial alternatives out there -
OpenLink Single-tier ODBC Driver for MySQL
I have been developing a quite large application, and I uploaded it to my server some days ago. Now I have found out it has several memory leaks - Uh oh.
My server is running Windows Server 2008 on 1GB ram. When I have 0 people online, only 550-600mb is used. When one people comes online the memory starts skyrocketing, and if 3-4 people are online all 1GB ram is used.
The application is made in ASP.NET with AJAX. It has many updatepanels which runs every second and quite a lot of javascript. It uses 5-7 sessions at all times. I use LINQ to SQL as database communication.
I tried perfmon.exe on my server, and I found:
Gen 0 collections goes from 0% to
100% within minutes
Gen 1 collections
goes from 0% to 50% within 5 minutes
Gen 2 is very close to 0% at all
times
Total heap bytes goes up to
100% very fast
I also ran an analysis of my program with Visual Studio. 8% Of my total runtime is done in .ToList() methods, which properly is caused by LINQ to SQL.
My theories....
(1) Linq to SQL dataContext
This might be a crazy thing to do, but: In my data access layer I have a load of methods:
AddSomethingToDatabase();
AddSomethingElseToDatabase();
DeleteSomethingFromDatabase();
Each of these has the following initialization:
GameDataContext db = new GameDataContext();
Which means the above statement runes nearly every second or more.
(2) No objects implement IDisposable
I have to be honest: I have never worked with IDisposable. As far as I have read, this might be a problem.
Also, if this is the leak, which classes should implement it? I do not have any I/O work or others, only the DataContext.
(3) Loads of UpdatePanels and jQuery
I have some fear loads of updatepanels can give problems with performance, but I do not know how to check it.
So my question is: Any ideas on what the memory leak could be? Any ideas on how to find the memory leak? And any ideas on how to solve it?
I would love to hear from someone who has experience with the situation above!
Thanks,
Lars
I am not sure at all that there is a problem here. All the suggestions for memory leak troubleshooting seem to be just really bad advice when you have not yet established that you have a memory leak since your memory on the server is so low that this cannot be established.
So here is my 2 cents - some might not like it but as long as it could point you at the right direction, I do not mind the downvotes.
It seems that you have a very stringent memory requirement. 1GB of RAM for a Windows 2008 Server just gives about enough RAM to do its OS related job. This is way way below recommended RAM requirements for it which if I am not wrong is minimum 2 GB RAM. Overhead of just running a w3wp.exe and IIS would be around 200-300 MB. The fact that generation 2 is always is around 0% is the best evidence that all looks good and your server is probably being starved of the memory.
My suggestion is to give your server at least 2GB of RAM (4GB should be better) and then monitor the memory usage and see if it is going up. If so, post another question with your findings and we should be able to help.
You absolutely must ensure that IDisposable objects get Dispose called when you are done with them. The simplest way to do this is to use using:
using (GameDataContext db = new GameDataContext())
{
// code that uses 'db' goes in here
}
// Dispose called when 'using' scope ends
If you still have problems after doing this throughout, then profiling is needed, but fix this first since it's a no-brainer.
Your own objects usually only need to implement IDisposable if they encapsulate unmanaged resources for which you wish to guarantee deterministic release back to the OS, so that those resources - file handles, sockets, and so on - are not sitting around waiting for GC for an interval of time you cannot rely on.
I don't have an answer for your question 3), sorry.
I'd recommend you use a memory profiler. Redgate's ANTS is pretty superior; it can give you a breakdown of which objects are in memory at a given time.
I am not expert at this. But If you try ANTS Memory Profiler might help you figure out where the problem is.
Scitech memory profiler found our leaks and gives good advice.