Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 28

Thread: Mafia freezes and becomes unplayable, don't know if it is with Mafia or my system

  1. #1
    Junior Member
    Join Date
    Sep 2016
    Location
    Central Illinois, USA
    Posts
    3

    Default Mafia freezes and becomes unplayable, don't know if it is with Mafia or my system

    I have had no problems with my computer and using KOLMafia for about 3 weeks. Then it started to lag and then freeze up. I hadn't done anything different with any of my programs on my computer and didn't think I did any changes to KOLMafia either.

    I looked back through the forums, and someone mentioned that since this might not be a bug, it should be posted in Community support, so I hope this is where it should go.

    FYI, I am not well-versed in Computer technology and tech speak (KOLMafia basic info is barely within my grasp of knowledge), but hopefully could help diagnose the problem.

    Chrome for the browser
    Windows 10



    Problem:

    In running Mafia, it will run about 15 to 20 adventures before lagging and maybe running another couple and then freezing up.
    When trying to log out of Mafia, it hangs on different things and won't log out. I have to shut it down.
    When I bring it back up, it freezes on different things (like checking moon signs, or updating storage, or doing breakfast) and won't bring up the relay browser or won't bring it up all the way.
    I may have to shut down and restart it a couple of times for it to get to a point that I can it to run another 20 adventures or so.

    What previously had taken about 10 to 20 minutes to burn my 200+ turns (just adventuring in one zone with no changes or anything), now takes over a few hours.

    What I have done to try and fix the issue:
    - I have updated to the most recent build. Did not change the lag
    - I have changed the location to another folder on my computer. I started with only the daily build, and then added some scripts - like Ezandora's Guide, CHiT, and other helpful assisting scripts. - still lagged on simple turn burning.
    - I installed the Mafia on a thumb drive - still lags and freezes up, no change.
    - I made explorer as the browser - no change, still freezes and lags

    - Thought that maybe it was my Antivirus. I uninstalled Mcafee. - I tried with just Windows Defender and it still freezes.
    - I installed another antivirus - Avast. and still freezes
    - I uninstalled Java and then reinstalled the current java. still freezes,


    So I may have shot myself in the foot for help by deleting my old builds and copies of mafia that were on my computer. I see that I only have Debug's from Feb 09 and Feb 10th 2018. The other Debug's that I have were from Dec 2017 and before.

    I would appreciate any help that can be given to see if I can get back to using mafia daily with the many restarts and freezing. Thank you in advance!

    Edit: If you think you may be able to help, please reply here or shoot me a kmail in the game. I have access to the game at work, but not usually the forums. Thanks!
    Last edited by deadleeplatapus; 02-12-2018 at 04:08 PM. Reason: added additional way to contact me

  2. #2
    Junior Member
    Join Date
    Nov 2017
    Location
    Singapore
    Posts
    9

    Default

    I wish to add that OP isn't alone in facing these problems - I too have had the exact same issues with Mafia starting from January 2018 (also running Windows 10).

    In a similar fashion, I have
    - Reinstalled Java (Java 8, Java 9, JRE1.8.0) and have tested them independently (by uninstalling all but one) with the latest daily builds and KoLMafia 17.12.
    - Completely deleted all files and logs related to KoLMafia, re-downloaded and ran it in a new, separate folder (reinstalling all the scripts and rewriting my CCS)
    - Tried running KoLMafia on my laptop instead of my desktop
    - Turned off my Anti-Virus
    - Changed the default browser
    - Cleared my Java Cache
    - Ran memtest86 overnight to check if there was any memory issues (none found)

    Certain things I've noted while trying to fix the issue myself (albeit to no avail):
    - Vanilla KoL experiences no lag, but accessing links throughout the kingdom (even the main page itself) using the relay browser on KoLMafia does have a significant lag time
    - Closing KoLMafia when it freezes (as described by OP) does not always delete the "active_session.1" file. This occurs when there is still a JRE process running in the Task Manager, which prevents the deletion of the file. (Ending the process in Task Manager allows for the manual deletion of the file). Opening KoLMafia while the "active_session.1" file exists creates an "active_session.2" file, although multiple sessions do not appear to be the cause of the lag/freezing (regardless of whether I actively try to ensure a single session, it doesn't seem to have any effect on the lag/freezes)
    - Scripts appear to end prematurely, especially when the script attempts to access the inventory or change equipment (specifically, VeracityMeatFarm.ash crashes on these instances - red links which give access to the individual inventory tabs appear on the Graphical CLI; crashes also occur when changing to the Protonic Accelerator Pack). Scripts also do not appear to be able to run properly (VeracityMeatFarm.ash is unable to acquire items and I have to acquire them manually [even though I constantly check prefref to ensure that the meat amount is set well above the items I need to acquire]). I believe this may be due to the fact that KoLMafia is unable to access the data (potentially due to the lag/freezes), which brings up edge/unique cases such as the time I logged in but KoLMafia did not identify that I had any items whatsoever (e.g. the dropdown box in the Gear Changer did not show any other options other than the items I was currently equipping).

    I have also noticed that a few other KoLers are also experiencing the same symptoms:
    https://www.reddit.com/r/kol/comment.../kolmafia_lag/

    Digging up past issues with KoLMafia on various forums and trying their solutions also does not seem to have helped solve this issue.

    I would also greatly appreciate if any KoLMafia developers could provide any help in troubleshooting this issue. Many thanks in advance! (I really suspect that the issues are the same and hope I am not unwarrantedly hijacking this thread)

  3. #3
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,126

    Default

    I have no specific suggestions or reasons to believe anything I say might apply. I am responding because both reports are well written and you deserve some kind of response/acknowledgement.

    The active session files are mafia's way to limit running instances of mafia to two. If mafia does not exit normally then they will be left behind. As noted, if any are present and mafia is not running, the standard procedure is just to delete them.

    I have sometimes been informed of mafia detected weirdness if I open the gCLI window before logging in. Some messages have appeared there that are not logged anywhere else and indicate that a communication error occurred. Mafia just sits there when retrying or informing the user or treating the error as fatal and exiting might be expected behavior. Worth a shot.

    I personally do not like Chat. Because it is a feature I personally don't use I am willing to blame all sorts of things on it, even when there is no justification for doing so. Nevertheless I have noticed some thread related start up problems when Chat loads at start up. In my case they were intermittent, but seem to go away, after I stopped opening Chat at startup and closed it ASAP after I was done. (Easiest way to see if your fax worked is to open a chat window and then fax, for example). So I would ask whether not opening or using chat changes anything.

    I can't recall whether jstack is part of the run environment or the development environment. But if it is on your system it might be worth it to run it next time things slow to a crawl and share the results.

    While mafia is running, open a command line and type

    jps -1

    That should return a number, the processID of currently running Java processes. If there is no number, Java is not running which means mafia is not running. If there is more than one it means there are several Java processes and that might be the key.

    If it returns one number (the PID) then type

    jstack {PID}

    Copying the results and pasting them here might trigger something.

    {PID} is short hand for the process ID. Just type the number, not bracket number bracket.

    Do any other Java applications run fine on the system?

    If you run Task Manager is the Java task using a lot of CPU, Memory or Network. Is the amount used a significant portion of the available resources?

    A general slowdown that gets worse over time can be related to memory usage. Does triggering garbage collection (there's a button on the top right if memory serves) effect things?
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  4. #4
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,126

    Default

    I skimmed the reddit comments and was reminded that I have had lag in the relay browser because of my browser settings. Various ad blockers or cookie managers would introduce a lag that went away when I explicitly disabled them. At least once, but not repeatably, I got a message from the browser that said a script on the page was taking a long time. Did I want to abort? So a plain vanilla instance of the browser or changing which browser mafia is using might shed some light.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  5. #5

    Default

    I wish to add that OP isn't alone in facing these problems - I too have had the exact same issues with Mafia starting from January 2018 (also running Windows 10).
    Originally Posted by WARriorer View Post
    Does that mean you can use versions from before then without having any issues?

    A nice starting point would be "this version causes problems, this other version from soon before that does not cause problems".

    I don't think a list of anecdotes will help with fixing anything.

  6. #6
    Junior Member
    Join Date
    Nov 2017
    Location
    Singapore
    Posts
    9

    Default

    Thanks for the quick responses!

    I personally do not like Chat. Because it is a feature I personally don't use I am willing to blame all sorts of things on it, even when there is no justification for doing so. Nevertheless I have noticed some thread related start up problems when Chat loads at start up. In my case they were intermittent, but seem to go away, after I stopped opening Chat at startup and closed it ASAP after I was done. (Easiest way to see if your fax worked is to open a chat window and then fax, for example). So I would ask whether not opening or using chat changes anything.
    I had also thought that chat might have been an issue. Unfortunately, it doesn't seem to be the case (especially not when considering there are issues logging in through KoLMafia before anything is actually being done).

    I can't recall whether jstack is part of the run environment or the development environment. But if it is on your system it might be worth it to run it next time things slow to a crawl and share the results.

    While mafia is running, open a command line and type

    jps -1
    I'm probably doing this wrong, but opening Command Prompt on Windows 10 and typing "jps -1" gives "'jps' is not recognized as an internal or external command, operable program or batch file."

    If you run Task Manager is the Java task using a lot of CPU, Memory or Network. Is the amount used a significant portion of the available resources?

    A general slowdown that gets worse over time can be related to memory usage. Does triggering garbage collection (there's a button on the top right if memory serves) effect things?
    I'm afraid garbage collection does not seem to help at all when KoLMafia freezes up. I have repeatedly clicked on it when it hangs (to no avail). While KoLMafia is running, it uses ~250MB (I have an 8GB RAM, which isn't running anywhere near full capacity while I'm running KoLMafia). CPU and Network usage are also generally <10% with the other things I'm doing on the desktop (e.g surfing the net). There are times when the CPU usage spikes up to 50% for a split second (e.g. going from the login window to the logged-in interface), but this is not the case when KoLMafia freezes (currently testing [and freezing on] cc_snapshot.ash).

    I skimmed the reddit comments and was reminded that I have had lag in the relay browser because of my browser settings. Various ad blockers or cookie managers would introduce a lag that went away when I explicitly disabled them. At least once, but not repeatably, I got a message from the browser that said a script on the page was taking a long time. Did I want to abort? So a plain vanilla instance of the browser or changing which browser mafia is using might shed some light.
    I have changed the browser from Chrome to Firefox to Internet Explorer without much success in resolving this issue.

    Does that mean you can use versions from before then without having any issues?

    A nice starting point would be "this version causes problems, this other version from soon before that does not cause problems".

    I don't think a list of anecdotes will help with fixing anything.
    It doesn't appear to be an issue with the version - having done this previously (and just trying out version 18273 from 2 Dec 2017, which freezes while "Looking at item #...").

    Apart from the anecdotes, would any other information be helpful in troubleshooting? (and relatedly, how can I go about collecting such information?)
    Last edited by WARriorer; 02-13-2018 at 06:06 PM. Reason: Added information on CPU and Network usage

  7. #7
    Junior Member
    Join Date
    Nov 2017
    Location
    Singapore
    Posts
    9

    Default

    I don't think a list of anecdotes will help with fixing anything.
    Also, I do apologise if the anecdotes made the whole post convoluted. I didn't want to come across as demanding a solution without putting in the necessary work/research myself, especially so if it turns out that there was a quick and simple fix that I had missed out (and I'm sure OP had the same intentions).

  8. #8

    Default

    The anecdotes are fine. I'm just pessimistic about those anecdotes, or others that people might feel like contributing, leading to any fix.

  9. #9
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,126

    Default

    Thanks for the quick responses!
    Originally Posted by WARriorer View Post
    Sounds like jps and jstack are part of the development environment which you don't have installed. Not worth getting you to try that yet.

    Since I infer sometimes the symptoms occur at startup.

    Consider this:

    Launch KoLmafia but do not log in. (Disable auto login and restart if necessary).
    Open the gCLI using General->Graphical CLI from the Login Screen
    Wait because this step takes more time than most people should but still less than two minutes on my system.
    When the gCLI opens, switch to it.
    Click the Preferences button.
    Navigate to Look & Feel -> Main Interface.
    Make sure Relay Server and Loathing Chat are NOT listed under Startup as Window and Startup in Tabs.
    (Change things if they are).
    Close the Preferences Window.
    Optionally separate the Login and gCLI windows so you can watch the latter while interacting with the former.
    Select the Login Window and log in.
    Observe the gCLI.

    My experience has been that if something unexpected happens it appears in the gCLI and with a red font color.
    On my system, I open the gCLI in a tab during start up. This it is expected when KoLmafia closes the gCLI window and creates a gCLI tab. Just switch if/when that happens and know if it did that is expected.

    I notice I just did that and never saw "Looking at item". It is emitted by the code in APIRequest but I wonder why you see it and I don't? In Ye Olden Days when I got paid to write code we had several problems with JSON. They were all related to our code failing to link at run time to the expected JSON library. Grasping at straws but maybe there is something in APIRequest handling...
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  10. #10
    Developer
    Join Date
    Aug 2009
    Posts
    2,796

    Default

    Frono: the "Looking at item #..." message is passed into KoLmafia.updateDisplay(), which shouldn't show up in the gCLI (I think).

    edit: I also believe it only should invoke that if you encounter an item that isn't in Mafia's datafiles.
    Last edited by heeheehee; 02-13-2018 at 11:13 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •