Pages:<< prev 1 next >>
#1 Sep 22, 2016 1:06 am
Apprentice
GroupMembers
Posts63
JoinedDec 23, 2007
So the I3 snippet I've added to my mud is doing something weird. Originally it was fine, but now it is using ridiculous amounts of RAM.
Each time I copyover, the RAM usage increases by over 200MB. Earlier today RAM usage was at over 1.2GB.
Upon investigation, I found that the file i3.channels is a whopping 60MB.
It would seem that the two are related.
Each time I copyover, the RAM usage increases by over 200MB. Earlier today RAM usage was at over 1.2GB.
Upon investigation, I found that the file i3.channels is a whopping 60MB.
It would seem that the two are related.
#2 Sep 22, 2016 8:56 pm
Kasji,
You probably already did this, but did you try commenting out i3 in makefile and see if copyover still gives the ram issues?
You probably already did this, but did you try commenting out i3 in makefile and see if copyover still gives the ram issues?
#3 Sep 23, 2016 11:35 pm
Last edited Sep 23, 2016 11:35 pm by Kasji
Apprentice
GroupMembers
Posts63
JoinedDec 23, 2007
Yeah, that's the first thing I did. Mud runs at about 11MB RAM usage without I3.
Edit: Copyover doesn't increase RAM usage with I3 commented out.
Edit: Copyover doesn't increase RAM usage with I3 commented out.
#4 Sep 24, 2016 8:02 am
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005
My random guess would be that you aren't handling the existing socket (and the data already loaded), and are simply opening a new I3 connection on copyover, which would then duplicate the data as it re-initializes.
My own MUD doesn't have copyover/hotboot, but I have a modified SmaugFUSS version on github that does. Basically, you have to add the I3 socket descriptor to the arguments used when re-invoking the executable so it can restore the original socket without disruption.
Otherwise, make SURE you do an I3 disconnect before doing the copyover, and reconnect again afterwards. If you do it that way, make sure you don't reboot too frequenly (like every minute), or the I3 server may kick you for spamming the startup packet.
My own MUD doesn't have copyover/hotboot, but I have a modified SmaugFUSS version on github that does. Basically, you have to add the I3 socket descriptor to the arguments used when re-invoking the executable so it can restore the original socket without disruption.
Otherwise, make SURE you do an I3 disconnect before doing the copyover, and reconnect again afterwards. If you do it that way, make sure you don't reboot too frequenly (like every minute), or the I3 server may kick you for spamming the startup packet.
#5 Sep 25, 2016 9:32 pm
Last edited Sep 25, 2016 9:40 pm by Vladaar
Just curious did you use the instructions for smaug that dealt with copyover? I noticed it didn't have anything for copyover.c I added what I have in my copyover.c maybe that will complete it for you. LoL, nevermind I just scrolled all the way down the snippet and it does address copyover.c or hotboot.c file. The below is what mine looks like currently.
// In copyover.c find log_string("Executing copyover...."); /* * added this in case there's a need to debug the contents of the various files */ if(argument && !str_cmp(argument, "debug")) { log_string("Copyover debug - Aborting before execl"); return; } // add this #ifdef I3 if(i3_is_connected()) { i3_save_chanlist(); i3_save_mudlist(); i3_save_history(); } #endif // Next find #ifdef IMC if(this_imcmud) snprintf(buf3, 100, "%d", this_imcmud->desc); else strncpy(buf3, "-1", 100); // Add right below #ifdef I3 snprintf(buf4, 100, "%d", I3_socket); #else strncpy(buf4, "-1", 100); #endif #else #ifdef I3 snprintf(buf3, 100, "%d", I3_socket); #else strncpy(buf3, "-1", 100); #endif strncpy(buf4, "-1", 100); #endif // Next find log_string("Copyover recovery complete."); get_curr_players(); // Add this #ifdef I3 /* * Initialize and connect to I3 */ i3_startup(FALSE, port, 0); #endif
#6 Sep 26, 2016 2:31 am
Last edited Sep 26, 2016 2:34 am by Kasji
Apprentice
GroupMembers
Posts63
JoinedDec 23, 2007
There was a copyover portion in the snippet I followed. It has everything you've got there, except for one thing is different.
is actually:
fCopyOver is a bool for telling if there was a copyover during startup. I think that I'm facing two separate issues though. The RAM usage increase from copyovers is one thing, and the massive RAM usage period is another issue. I3 still uses over 200MB of RAM on a fresh startup. I figured it had to be related to the i3.channels file being over 60MB in size.
EDIT: I should also note that I am using g++ and std=c++11
i3_startup(FALSE, port, 0);
is actually:
i3_startup(FALSE, port, fCopyOver);
fCopyOver is a bool for telling if there was a copyover during startup. I think that I'm facing two separate issues though. The RAM usage increase from copyovers is one thing, and the massive RAM usage period is another issue. I3 still uses over 200MB of RAM on a fresh startup. I figured it had to be related to the i3.channels file being over 60MB in size.
EDIT: I should also note that I am using g++ and std=c++11
Pages:<< prev 1 next >>