mIRC Home    About    Download    Register    News    Help

Print Thread
#230077 23/02/11 09:08 PM
Joined: Mar 2010
Posts: 146
Masoud Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Mar 2010
Posts: 146
I am seeing an issue with 'Allocating memory' error - when it happens, mIRC default theme gets completely deformed in toolbar and switchbar. Also it removes my background images. You can see it visually by this Screenshot and normally it looks like this one.

Some information about this script:
The script has many script files and also uses some DLLs such as MDX, hOS and WhileFix. I'm using the same DLLs on my normal mIRC script and I've never had this issue. (Because mBOT is a bot script and it's running on a single mIRC.)
The only different between my normal mIRC and this bot is: The bot script has many hash tables and also it does many processes on them. (Like seen, Top10 and similiar stuff)
Normally it happens when i have this script open for longer than 1-2day(s) and when it happens i have to close the mIRC and re-run it...
Also i should mention that i'm using mIRC v7.17 on both scripts on Windows 7 32bit. If i recall correctly i have this problem from mIRC 7+. (I can't say that for sure... but i'll test earlier versions for you if it was necessary.)
I have installed the latest driver of my graphic card. (My graphic card is 'Gainward, GeForce 9500 GT' 1GB.)

Forgive me if my English isn't good enough to describe more about this issue. I'll give you more information if needed.

This is the alias that it says when it gives me error and line 155 is the line that marked with *
Code:
CxM {
  if (%DC-Toolbar == $null) { set %DC-Toolbar ON }
  if (%DC-Toolbar == ON) {
    toolbar -c
    if ($scid($activecid).status == connecting || $scid($activecid).status == connected) || (*logging* iswm $scid($activecid).status) {
      toolbar -axz1 Disconnect $+(",Disconnecting,$chr(32),from,$chr(32),$chr(40),$server,:,$port,$chr(41),") $+(",$noqt($DC.Imgs(Conn.ico)),") "/DC-Connection"
    }
    else { toolbar -axz1 Connect $+(",$_TB.LS,") $+(",$noqt($DC.Imgs(Connection.ico)),") "/DC-Connection" }
    toolbar -is Xsep
    toolbar -axz1 mIRCOpt "mIRC Options" $+(",$noqt($DC.Imgs(Options.ico)),") "/mOpt"
    toolbar -is Rsep
    toolbar -axz1 mB "mBOT Main Settings" $+(",$noqt($DC.Imgs(Set.ico)),") "/DC-mBOT"
    toolbar -axz1 Pro "Channel Protections" $+(",$noqt($DC.Imgs(Protections.ico)),") "/BotPro"
    toolbar -axz1 Members "Member Area" $+(",$noqt($DC.Imgs(F-Sh.ico)),") "/MemberMgr"
    toolbar -axz1 Extra "Extra Settings" $+(",$noqt($DC.Imgs(Extra.ico)),") "/Extra-Settings"
    toolbar -axz1 Seen "xSeen System" $+(",$noqt($DC.Imgs(Seen.ico)),") "/xSeen"
    toolbar -axz1 Admin "Server Administrator Settings" $+(",$noqt($DC.Imgs(Oper.ico)),") "/MyOper"
    toolbar -axz1 AJoin "Connection Manager" $+(",$noqt($DC.Imgs(ConSetting.ico)),") "/ConMgr"
    toolbar -axz1 TB "Talk Bot" $+(",$noqt($DC.Imgs(TB.ico)),") "/Talk.Bot"
    toolbar -axz1 DCLogs "Log Viewer" $+(",$noqt($DC.Imgs(Log.ico)),") "/DCLogs"
    toolbar -axz1 BackUp "Backup Wizard" $+(",$noqt($DC.Imgs(BackUp.ico)),") "/DC.BackUp"
    toolbar -is Msep
    toolbar -axz1 Help "Help Centre (Do you have any problem with mBOT? Click here to solve it!)" $+(",$noqt($DC.Imgs(M1.ico)),") "/Start_Help"
    * toolbar -axz1 DC-About $+(",About DC mBOT,$chr(32),$DC.Ver,") $+(",$noqt($DC.Imgs(About.ico)),") "/mBAbout"
    toolbar -is Bsep
  }
  else { toolbar -r }
}


Edit: Just as a side note i should mention that this bot script is minimized to tray most of times.

Last edited by Khaled; 24/02/11 09:48 AM.

Nothing...
Joined: Mar 2010
Posts: 146
Masoud Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Mar 2010
Posts: 146
There is another thing that i forgot to mention: The mIRC's icon in system tray (Beside the Windows clock in taskbar) disappears when this problem occurs. Not really disappear, it's just a blank icon that i just can see THERE IS SOMETHING but it has no icons.

Also, i renew the Toolbar only with ON ACTIVE and ON APPACTIVE events.


Nothing...
Joined: Dec 2002
Posts: 5,420
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,420
This is a generic error that indicates that mIRC was unable to allocate the required memory to perform a certain function. As with any programming language, it is very easy to make mIRC display this error - all you have to do is to allocate huge numbers of hash tables or binary variables, load large numbers of bitmaps, and so on. At some point, when system resources have been used up, mIRC will return this error and you will probably start to see other applicatons behave strangely as well. You will need to review the scripts you are using to see where the memory is being allocated and whether your scripts are freeing it correctly when necessary.

Joined: Mar 2010
Posts: 146
Masoud Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Mar 2010
Posts: 146
Well, i was thinking about the same thing and yes, the script has many hash tables (heavy tables..)
I was talking about this issue with some decent scripters but most of them didn't agree with me that heavy hash tables may cause this problem (Because i have no binary variables). However, i was kinda sure about it.
I'm know which addon may caused this problem. I have to manage the script again and maybe i have to remove it or totally re-write it.

Thank you for your reply.


Nothing...
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
One thing you could do is only keep data in memory that is constantly being accessed.

If you're only referencing data every so often then the overhead of it being on the hard drive doesn't really matter.

Joined: Mar 2010
Posts: 146
Masoud Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Mar 2010
Posts: 146
I'm not sure if Khaled has changed anything or something, but it seems that i don't have this issue anymore with v7.22. I've my bot running for 3 days now and no problems yet.
(Or maybe i've changed something in my codes which was effective, lol)


Nothing...
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
You will run into the problem again. mIRC can't change how memory is allocated in the OS. It's more likely that you're just not seeing the failure *yet*.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Mar 2010
Posts: 146
Masoud Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Mar 2010
Posts: 146
Originally Posted By: argv0
You will run into the problem again.

I hope not so, lol

Originally Posted By: argv0
mIRC can't change how memory is allocated in the OS.

Yeah, i know that.

P.S.: I just wanted to let Khaled know about it. (It's almost 4days, and yet no allocating memory problem.)


Nothing...
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: Masoud
I hope not so, lol


If you haven't actually changed the script, you will. Although 7.22 is not 7.17, there's no reason to believe any drastic changes to memory management were made between those versions. What might have happened is that mIRC lowered its resource footprint just enough to not trigger the error with the amount of data you have now, but once you start adding more data and functionality to that script, my guess is you'll be seeing the error again.

versions.txt shows only 30 or so minor bug fixes, and none of them look related to memory usage. I would fix the problem by doing what was suggested (don't store so much data in memory) rather than pretending it no longer exists.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard