{"action":"created","issue":{"url":"https://api.github.com/repos/MegaMek/mekhq/issues/685","repository_url":"https://api.github.com/repos/MegaMek/mekhq","labels_url":"https://api.github.com/repos/MegaMek/mekhq/issues/685/labels{/name}","comments_url":"https://api.github.com/repos/MegaMek/mekhq/issues/685/comments","events_url":"https://api.github.com/repos/MegaMek/mekhq/issues/685/events","html_url":"https://github.com/MegaMek/mekhq/issues/685","id":310104392,"number":685,"title":"OutOfMemoryError on Princess bot turn","user":{"login":"BlueThing00","id":21363819,"avatar_url":"https://avatars2.githubusercontent.com/u/21363819?v=4","gravatar_id":"","url":"https://api.github.com/users/BlueThing00","html_url":"https://github.com/BlueThing00","followers_url":"https://api.github.com/users/BlueThing00/followers","following_url":"https://api.github.com/users/BlueThing00/following{/other_user}","gists_url":"https://api.github.com/users/BlueThing00/gists{/gist_id}","starred_url":"https://api.github.com/users/BlueThing00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlueThing00/subscriptions","organizations_url":"https://api.github.com/users/BlueThing00/orgs","repos_url":"https://api.github.com/users/BlueThing00/repos","events_url":"https://api.github.com/users/BlueThing00/events{/privacy}","received_events_url":"https://api.github.com/users/BlueThing00/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-30T16:09:52Z","updated_at":"2018-03-30T16:13:25Z","closed_at":null,"author_association":"NONE","body":"### Environment\r\nMekHQ: 0.43.9\r\nOS: Windows 10\r\nJava: 1.8.0_161-b12\r\n\r\n### Description\r\nI am occasionally getting an OutOfMemoryError on Princess's turn, resulting in MegaMek hanging.  I believe this is the 5th time this has happened in 45 battles in my current campaign.\r\n\r\nThis is the callstack of the error:\r\n```\r\nException in thread \"AWT-EventQueue-0\" java.lang.OutOfMemoryError: unable to create new native thread\r\n\tat java.lang.Thread.start0(Native Method)\r\n\tat java.lang.Thread.start(Unknown Source)\r\n\tat megamek.client.bot.BotClient$1.gameTurnChange(BotClient.java:134)\r\n\tat megamek.common.event.GameTurnChangeEvent.fireEvent(GameTurnChangeEvent.java:51)\r\n\tat megamek.common.Game.processGameEvent(Game.java:3132)\r\n\tat megamek.common.Game.setTurnIndex(Game.java:743)\r\n\tat megamek.client.Client.changeTurnIndex(Client.java:564)\r\n\tat megamek.client.Client.handlePacket(Client.java:1306)\r\n\tat megamek.client.bot.princess.Princess.handlePacket(Princess.java:1594)\r\n\tat megamek.client.Client$1$2.run(Client.java:220)\r\n\tat java.awt.event.InvocationEvent.dispatch(Unknown Source)\r\n\tat java.awt.EventQueue.dispatchEventImpl(Unknown Source)\r\n\tat java.awt.EventQueue.access$500(Unknown Source)\r\n\tat java.awt.EventQueue$3.run(Unknown Source)\r\n\tat java.awt.EventQueue$3.run(Unknown Source)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)\r\n\tat java.awt.EventQueue.dispatchEvent(Unknown Source)\r\n\tat java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)\r\n\tat java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)\r\n\tat java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)\r\n\tat java.awt.EventDispatchThread.pumpEvents(Unknown Source)\r\n\tat java.awt.EventDispatchThread.pumpEvents(Unknown Source)\r\n```\r\nWhen this happens, the buttons in MegaMek stop drawing correctly (they are the same color as the background).  Unfortunately, I did not think to grab a screenshot before restarting the client.  That makes me wonder if this is related to the tooltip error that also shows in the logs (and which has been fixed).\r\n\r\nI have to restart MekHQ to get Princess to work correctly again.  After doing so, I load the game and it works fine.\r\n\r\nThis is the memory usage from megameklog.txt:\r\n```\r\n08:31:35,842 INFO [megamek.server.Server] {Packet Pump} \r\nRound 0 memory usage: 211,760 kB\r\n\r\n08:32:54,785 INFO [megamek.server.Server] {Packet Pump} \r\nRound 1 memory usage: 336,031 kB\r\n\r\n08:35:24,893 INFO [megamek.server.Server] {Packet Pump} \r\nRound 2 memory usage: 390,298 kB\r\n\r\n08:38:54,350 INFO [megamek.server.Server] {Packet Pump} \r\nRound 3 memory usage: 429,408 kB\r\n\r\n08:43:24,805 INFO [megamek.server.Server] {Packet Pump} \r\nRound 4 memory usage: 302,279 kB\r\n\r\n08:45:56,301 INFO [megamek.server.Server] {Packet Pump} \r\nRound 5 memory usage: 393,436 kB\r\n\r\n08:50:15,676 INFO [megamek.server.Server] {Packet Pump} \r\nRound 6 memory usage: 361,719 kB\r\n```\r\n\r\nThe memory usage doesn't look insane.  I could attach megameklog.txt as well, but it is quite large and there doesn't seem to be anything else of note.\r\n\r\n### Files\r\n[mekhqlog.bak.txt](https://github.com/MegaMek/mekhq/files/1864063/mekhqlog.bak.txt)\r\n\r\nThere is another log showing this attached to this bug:\r\nhttps://github.com/MegaMek/mekhq/issues/682"},"comment":{"url":"https://api.github.com/repos/MegaMek/mekhq/issues/comments/377559880","html_url":"https://github.com/MegaMek/mekhq/issues/685#issuecomment-377559880","issue_url":"https://api.github.com/repos/MegaMek/mekhq/issues/685","id":377559880,"user":{"login":"NickAragua","id":29387808,"avatar_url":"https://avatars2.githubusercontent.com/u/29387808?v=4","gravatar_id":"","url":"https://api.github.com/users/NickAragua","html_url":"https://github.com/NickAragua","followers_url":"https://api.github.com/users/NickAragua/followers","following_url":"https://api.github.com/users/NickAragua/following{/other_user}","gists_url":"https://api.github.com/users/NickAragua/gists{/gist_id}","starred_url":"https://api.github.com/users/NickAragua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickAragua/subscriptions","organizations_url":"https://api.github.com/users/NickAragua/orgs","repos_url":"https://api.github.com/users/NickAragua/repos","events_url":"https://api.github.com/users/NickAragua/events{/privacy}","received_events_url":"https://api.github.com/users/NickAragua/received_events","type":"User","site_admin":false},"created_at":"2018-03-30T16:13:25Z","updated_at":"2018-03-30T16:13:25Z","author_association":"MEMBER","body":"A couple of questions:\r\n\r\n1) What phase is this happening on?\r\n2) Is that phase set to simultaneous?"}}
{"actor":{"display_login":"NickAragua"}}