作者:复古天堂
- OS: Windows XP 5.1 (Build: 2600)
- CPU: GenuineIntel PentiumPro-class processor @ 3608 MHz with 1023MB RAM
- Video: NVIDIA GeForce RTX 2060 SUPER (4614)
- Insufficient Memory.
- Please check the Virtual Memory Option and avilable hard drive space.
- You can check them by going to : Control Panel->System->Advanced->Performance->Settings->Advanced->Virtual memory.
- <?int?Core.Errors.History?>: FMallocWindows::Malloc <- FMallocWindows::Realloc <- 356E0000 469032 FArray <- FArray::Realloc <- 19543*24 <- FCanvasUtil::DrawTile <- FDynamicActor::Render <- Actor <- TranslucentRendering <- RenderLevel <- FLevelSceneNode::Render <- FPlayerSceneNode::Render <- UGameEngine::Draw <- UWindowsViewport::Repaint <- UWindowsClient::Tick <- ClientTick <- UGameEngine::Tick <- UpdateWorld <- MainLoop
复制代码 具体内容是客户端崩溃后推荐调大虚拟内存,然并卵。
从<?int?Core.Errors.History?>可以看出,core接口调用了errors错误提示,具体内容大意上是某UI界面刷新异常过多,导致内存溢出,然后导致的客户端崩溃 然而在没有core源码的情况下我们需要分析出具体问题 通过IDE定位到导致崩溃异常的内容(怎么定位参照dbg打的断点信息) 我们可以看到当服务端发送InventoryUpdate封包到客户端上时,线程过多,导致线程阻塞,然后导致客户端异常崩溃. 那么我们就可以在内核里对InventoryUpdate进行一些优化. 在内核里对所有引用InventoryUpdate的类进行仔细检查 会发现L2PcInstance类下的addItem方法(如图):
其中_inventory.addItem(process, itemId, count, this, reference); InventoryUpdate playerIU = new InventoryUpdate(); //创建背包UI界面类playerIU.addItem(item);//往对象里添加道具sendPacket(playerIU);//发送UI封包
这样会导致玩家打到道具后,服务端不断的向客户端发送背包界面UI刷新的封包 从而导致客户端不断接收UI刷新命令,最后导致客户端内存溢出崩溃. 但是如果玩家在打开背包情况下击杀获得道具,界面将不会进行刷新.
|