mIRC Homepage
Posted By: Jedisbar mIRC taking up far too much cpu power - 30/03/07 12:11 AM
I run two copies of mirc, both in seperate folders and neither reading anything from the others files, and have yet to have an issue with it.

I run 1024 mb ram, 3ghz pentium 4, and mirc.exe is taking up anywhere from 30-40% of the processor, each. This is only recent, and I don't think it's my windows install going coruppt; There's serious system lag, and I did a reinstall of both mirc and windows to make sure.

One of the copies is a bot so I checked if I'd somehow started a loop, timer, etc automation I shouldn't off and it all works out, same with my other instance(the non-bot one).

Anyone have any ideas? All help greatly apprciated.
Heh. The same thing has been happening to me lately. It might be because I am usually on 65+ channels over 1 network and a lot of people using commands might take up a bit CPU especially if most of your scripts are sockets. About 2X a day my bot's mIRC locks up while minimized and the bot's ping Timeout. This means I must end the process manually and re-boot mIRC. Does anybody have any solutions to this because I think it would help me and Jedisbar greatly smile
Posted By: HyperBlasT Re: mIRC taking up far too much cpu power - 30/03/07 09:48 PM
omg
I've got the same problem,
I run 1024mb ram and pentuim 4 too, and the mIRC still takes
too much from my CPU power
and like you I always think its cuz of the timers, loops and shit
but i cant find an answer.
I'm joining to the question
Posted By: RusselB Re: mIRC taking up far too much cpu power - 31/03/07 12:32 AM
First thing you should do, is see if the same thing happens with no scripts loaded.
If the problem doesn't show up, then keep trying it, using one script at a time until it reappears. NOTE: It'd be best to check each script one at a time (ie:load one, test it, if the problem doesn't occur, unload the script, load the 2nd, etc.)

If the problem reappears doing it like that, then the script that you just loaded is part (if not all) of the problem.
If it doesn't show up, then try loading various sets of scripts (ie:1 & 2, 1 & 3, 1 & 4, 2 & 3, 2 & 4, 3 & 4,...)

Just keep trying various combinations until the problem reappears.
Once the problem reappears, then we (should) have an idea as to which script(s) is/are causing the problem and we can review the script and see if it can be improved (odds are, if a script is causing that much usage, then it can be improved)
Posted By: RusselB Re: mIRC taking up far too much cpu power - 31/03/07 12:36 AM
Specifically for you, check your socket scripts to ensure that the sockets are open for the smallest amount of time possible.
Next, consider reducing the number of channels that you're on, or possibly set up a second/third installation of mIRC to handle some channels.
Thirdly, consider adding restraints so that you don't get (for example) 50 people sending the same command at the same time.
I do have a flood protection script that ignores a user if they post 3 lines in 5 seconds. I will check on the socket scripts, though. Thanks a lot!
Posted By: Jedisbar Re: mIRC taking up far too much cpu power - 01/04/07 12:46 PM
Loaded up my client version, unloaded all scripts and restarted it. Same problem, seems worse now with 50% useage. Made a fresh, completely untouched by anything install... same problem.
Posted By: Riamus2 Re: mIRC taking up far too much cpu power - 01/04/07 02:58 PM
Just to test, try temporarily disabling your firewall and antivirus/antispyware/antitrojan software and run mIRC. See if the CPU usage is still high. Once you know, you can enable those again. As long as you're not using the web and don't type weird stuff in mIRC that people may tell you to write, you don't need to worry about disabling those temporarily.

Also, when does the CPU usage go up? Is it when mIRC's running, but not connected? Is it when it's connected to multiple channels, or just one? Is it while sending or receiving files? More specific information would help. I run 2 copies of mIRC. My bot uses 0% cpu at all times, and Invision uses 3-5% due to a lot of hash tables (something I still need to try and cut down at some point).
Posted By: Jedisbar Re: mIRC taking up far too much cpu power - 01/04/07 07:10 PM
Already done the anti-virii step, no effect.

Clients on 2 servers, multi channels each, bot's on 2 of the same, same channels I'm already in. I haven't got a clue what the trigger is, sometimes it's that large from the word go, sometimes it takes a few minutes to kick in, sometimes hours. I am beginning to suspect mircstats may be part of the problem, since that's begun to hang but I'm not sure if that's a cause or an effect of this, I haven't changed a setting on any of this and it just started happening.
Posted By: DJ_Sol Re: mIRC taking up far too much cpu power - 01/04/07 07:33 PM
I am curious if you use hash tables. How many hash tables do you use, what is the size vs. amount used.

Also, what dll's do you use.
Posted By: RusselB Re: mIRC taking up far too much cpu power - 01/04/07 08:19 PM
I know a person on Maximum-IRC that runs mircstats, but I don't know if he's run into these problems or not. I'll ask next time I see him.
I have several hash tables. My seen.hsh is almost 5 megs worth of data, may that be a problem. All the other hash tables are fairly small. I dont use any DLL's on my bots mIRC excepct Open SSL where the DLL isnt even in the folder.

Also the sockets arent the problem. I tested each one.
Posted By: RusselB Re: mIRC taking up far too much cpu power - 01/04/07 10:51 PM
Quite likely, since hash tables are stored in RAM until they are freed, either by mIRC closing or the /hfree command being used.

You should check the amount of RAM you're starting with, and see how much other programs are using. If the total RAM being used is more than about 50% of your total RAM, then your system is (or should be) using a swap file, which means disk access, which, as I've said before, is extremely slow.
Ahh! Yes! Hash Tables are stored in RAM. I hadn't thought of that! Maybe I should clear them or seperate them, or use an INI file. Woot! Thanks! I think you found my problem!
Posted By: Riamus2 Re: mIRC taking up far too much cpu power - 02/04/07 01:06 AM
That's the issue I mentioned with Invision. It has a lot of tables, so it uses extra CPU (not much, but noticeable if you look at the task manager). I'm curious about the 5MB table. What's it for? Hash tables are good for data that is used frequently (usually, that means that the table is fairly small). If you have data stored that isn't used often, then saving it to a file is probably better.

You could easily find out if that's the problem by freeing the table and checking your CPU usage.
The hash table was used in my seen script that I had created for my bot. Imagine, a hash table last cleared when the bot/script was created (December 10th, 2006) and on average the bots are on 65 channels with 35 users on average, peaking at over 100 channels. After a few months the amount of unique users my bot is going to see are extremely high, which is why the hash table was 5.56 megs. I just free'ed and deleted the hash table so we can start clean. Now its at 4 kb laugh Hopefully this will solve the problem. *Keeps his fingers crossed*

Again, thanks for all the help.
Posted By: Riamus2 Re: mIRC taking up far too much cpu power - 02/04/07 01:21 AM
You may want to have the table automatically clear anyone who hasn't been seen in over 2 or 3 months or something.
I could do that. I do store the $ctime in the hash. If I periodically check to see if $ctime - CTIME is over 2419200 seconds (4 weeks), remove that item. Again, another good idea that I could easily implement.

Again, Thanks.

EDIT: This might be a problem if you have 10,000 unique items in the hash. A while loop might not be the best way to attempt this. Any ideas?
Posted By: RusselB Re: mIRC taking up far too much cpu power - 02/04/07 01:50 AM
If you have a commonality in the item names for these items, then you might be able to use /hdel -w <wildcarded item name>

See /help /hdel for more details.
Each item is a different address mask. Then for each value of the item I use $gettok. I guess in this case /hdel wouldn't help me.
Posted By: RusselB Re: mIRC taking up far too much cpu power - 02/04/07 02:21 AM
No, it doesn't sound like it would be. I'm out of ideas at the moment, but if I think of anything I will post.
Posted By: Riamus2 Re: mIRC taking up far too much cpu power - 02/04/07 03:14 AM
You could save the hash table to a file, /filter it, manually delete all lines at the top or bottom (depending how you filter it), then load it again. That shouldn't take more than 5 minutes and won't "lock" mIRC while looping.
Originally Posted By: Riamus2
You could save the hash table to a file, /filter it, manually delete all lines at the top or bottom (depending how you filter it), then load it again. That shouldn't take more than 5 minutes and won't "lock" mIRC while looping.


interesting idea but the downside to that is that I have no idea how to use the /filter command, *goes off to the Help Guide*
Posted By: Jedisbar Re: mIRC taking up far too much cpu power - 03/04/07 10:20 AM
So I've just noticed that explorer.exe is taking up about 20% cpu versus it's normal 10 or so percent. Possible connection?
Posted By: Riamus2 Re: mIRC taking up far too much cpu power - 03/04/07 03:41 PM
Possibly. Explorer tends to take up extra resources if it crashes or if another program hangs.
Ok its not the hash table taking up the space because I just cleared it and it just locked up, and the seen.hsh is 100 bytes :\

i think its a while loop that is being kinda stupid.
Posted By: RusselB Re: mIRC taking up far too much cpu power - 03/04/07 11:05 PM
Definetely a possibility. If you want to post that section of your code in a new topic in the Scripts & Pop-ups forum, I (and I'm quite sure several others) will be happy to look at it and see if we can come up with something better.
That's just it. I don't know what section of code it is. I have about 60 files, 1 file per feature of my bot. I have several while loops in several different files. I was trying to back-track earlier to see what I could've added to make it mess up like this, but couldn't find anything.
Posted By: Riamus2 Re: mIRC taking up far too much cpu power - 03/04/07 11:57 PM
Although it will take time to do, I would go through and test one file at a time -- install one script and see if you have the problem. If not, uninstall it and install another one. Yes, it will take a lot of time to test all of them (unless you're lucky and it's the first one you test), but unless you can figure out where the problem is, that's your only real solution.

Just a note, though... You might try using Ctrl-Break when you're having problems (hit it 4-5 times in a row). Then, see if you see any error messages (check status and your active window). If so, that should give you an idea of where the error may be located.
I don't know how ctrl-break would work when your mIRC is minimized to your tray when it happens.
Posted By: Kardafol Re: mIRC taking up far too much cpu power - 04/04/07 08:05 PM
As far as I know, mIRC uses CTRL + BREAK as an global shortcut, meaning it wouldn't matter when you press it. I'm not exactly sure, though.
Posted By: Riamus2 Re: mIRC taking up far too much cpu power - 04/04/07 10:43 PM
Ctrl-Break works even when mIRC's minimized to the tray. Though I don't remember you saying that this only happens if it's minimized... if that's the case, that would be useful information to have when helping you.
I always minimize my Bot mIRC just so its not taking up a tab space in the Windows ToolBar.
Posted By: Riamus2 Re: mIRC taking up far too much cpu power - 05/04/07 04:40 PM
But, does it happen when it's not minimized? And did you try Ctrl-Break to see if it gives a message? I suggested trying it and you said you couldn't because it was minimized, which made no sense.
It hasnt locked up in over a day now. Maybe it's fixed, although I didn't do anything. We will see what happens over break. And if ctrl-break works globally, if I had several mIRC's open and only wanted one to break, how would I do it? Just thought a global ctrl-break would be kind of silly in that case.
Posted By: Riamus2 Re: mIRC taking up far too much cpu power - 06/04/07 05:44 PM
Well, it's just global if nothing is "active" in Windows. If you have everything minimized (or at least, not active), then it's global. If one mIRC (or another program) is maximized/active, then it's specific to that program. I believe this is a standard Windows behavior. In any case, this has allowed me to reopen a frozen mIRC that was minimized to the tray without having to kill the process.
Very intersting. I have been having to kill the process everytime this happened. Surprisingly it hasnt happened in over 2 days. I am curious as to what the problem was, but if it doesn't do it anymore thats just fine by me.
Posted By: Riamus2 Re: mIRC taking up far too much cpu power - 06/04/07 11:14 PM
Just remember that ctrl-break works if there is a loop or similar thing going on. If it's not script related, it probably won't help.
© mIRC Discussion Forums