memory leak fixes
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
1412b2ed07
commit
e2e3dcf2c9
@ -2011,6 +2011,7 @@ More profiling
|
|||||||
(05/27/2025)
|
(05/27/2025)
|
||||||
QuadMesh memory pooling
|
QuadMesh memory pooling
|
||||||
Load characters from save db when re-loading valid save
|
Load characters from save db when re-loading valid save
|
||||||
|
Fix memory leaks
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ public class ServerCollidableTree implements BehaviorTree {
|
|||||||
ServerGravityTree.getServerGravityTree(parent).start();
|
ServerGravityTree.getServerGravityTree(parent).start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(impulse.type.matches(Collidable.TYPE_WORLD_BOUND)){
|
if(impulse.type.matches(Collidable.TYPE_WORLD_BOUND) || impulse.type.matches(Collidable.TYPE_STATIC)){
|
||||||
this.resetGravityFall();
|
this.resetGravityFall();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,9 @@ public class JomlPool {
|
|||||||
data.y = 0;
|
data.y = 0;
|
||||||
data.z = 0;
|
data.z = 0;
|
||||||
lock.lock();
|
lock.lock();
|
||||||
JomlPool.vec3fPool.add(data);
|
if(JomlPool.vec3fPool.size() < 1000){
|
||||||
|
JomlPool.vec3fPool.add(data);
|
||||||
|
}
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +84,9 @@ public class JomlPool {
|
|||||||
data.y = 0;
|
data.y = 0;
|
||||||
data.z = 0;
|
data.z = 0;
|
||||||
lock.lock();
|
lock.lock();
|
||||||
JomlPool.vec3dPool.add(data);
|
if(JomlPool.vec3dPool.size() < 1000){
|
||||||
|
JomlPool.vec3dPool.add(data);
|
||||||
|
}
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -154,25 +154,45 @@ public class MessagePool {
|
|||||||
public void release(NetworkMessage message){
|
public void release(NetworkMessage message){
|
||||||
lock.lock();
|
lock.lock();
|
||||||
if(message instanceof EntityMessage){
|
if(message instanceof EntityMessage){
|
||||||
|
if(entityMessagePool.size() < 1000){
|
||||||
entityMessagePool.add(message);
|
entityMessagePool.add(message);
|
||||||
|
}
|
||||||
} else if(message instanceof LoreMessage){
|
} else if(message instanceof LoreMessage){
|
||||||
|
if(loreMessagePool.size() < 1000){
|
||||||
loreMessagePool.add(message);
|
loreMessagePool.add(message);
|
||||||
|
}
|
||||||
} else if(message instanceof PlayerMessage){
|
} else if(message instanceof PlayerMessage){
|
||||||
|
if(playerMessagePool.size() < 1000){
|
||||||
playerMessagePool.add(message);
|
playerMessagePool.add(message);
|
||||||
|
}
|
||||||
} else if(message instanceof TerrainMessage){
|
} else if(message instanceof TerrainMessage){
|
||||||
|
if(terrainMessagePool.size() < 1000){
|
||||||
terrainMessagePool.add(message);
|
terrainMessagePool.add(message);
|
||||||
|
}
|
||||||
} else if(message instanceof ServerMessage){
|
} else if(message instanceof ServerMessage){
|
||||||
|
if(serverMessagePool.size() < 1000){
|
||||||
serverMessagePool.add(message);
|
serverMessagePool.add(message);
|
||||||
|
}
|
||||||
} else if(message instanceof AuthMessage){
|
} else if(message instanceof AuthMessage){
|
||||||
|
if(authMessagePool.size() < 1000){
|
||||||
authMessagePool.add(message);
|
authMessagePool.add(message);
|
||||||
|
}
|
||||||
} else if(message instanceof CharacterMessage){
|
} else if(message instanceof CharacterMessage){
|
||||||
|
if(characterMessagePool.size() < 1000){
|
||||||
characterMessagePool.add(message);
|
characterMessagePool.add(message);
|
||||||
|
}
|
||||||
} else if(message instanceof InventoryMessage){
|
} else if(message instanceof InventoryMessage){
|
||||||
|
if(inventoryMessagePool.size() < 1000){
|
||||||
inventoryMessagePool.add(message);
|
inventoryMessagePool.add(message);
|
||||||
|
}
|
||||||
} else if(message instanceof SynchronizationMessage){
|
} else if(message instanceof SynchronizationMessage){
|
||||||
|
if(synchronizationMessagePool.size() < 1000){
|
||||||
synchronizationMessagePool.add(message);
|
synchronizationMessagePool.add(message);
|
||||||
|
}
|
||||||
} else if(message instanceof CombatMessage){
|
} else if(message instanceof CombatMessage){
|
||||||
|
if(combatMessagePool.size() < 1000){
|
||||||
combatMessagePool.add(message);
|
combatMessagePool.add(message);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Unsupported message type! " + message.getClass());
|
throw new Error("Unsupported message type! " + message.getClass());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package electrosphere.server.macro.character;
|
|||||||
import org.joml.Vector3d;
|
import org.joml.Vector3d;
|
||||||
import org.joml.Vector3i;
|
import org.joml.Vector3i;
|
||||||
|
|
||||||
import electrosphere.collision.PhysicsEntityUtils;
|
|
||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
import electrosphere.entity.Entity;
|
import electrosphere.entity.Entity;
|
||||||
import electrosphere.entity.state.server.ServerCharacterData;
|
import electrosphere.entity.state.server.ServerCharacterData;
|
||||||
@ -61,8 +60,6 @@ public class PlayerCharacterCreation {
|
|||||||
//must come after the player is assigned, otherwise the player will not get the item attachment messages
|
//must come after the player is assigned, otherwise the player will not get the item attachment messages
|
||||||
CreatureUtils.serverApplyTemplate(realm, newPlayerEntity, template);
|
CreatureUtils.serverApplyTemplate(realm, newPlayerEntity, template);
|
||||||
|
|
||||||
PhysicsEntityUtils.disableBody(realm.getCollisionEngine(), newPlayerEntity);
|
|
||||||
|
|
||||||
//if macro data hasn't been generated in this area, generate it
|
//if macro data hasn't been generated in this area, generate it
|
||||||
//but only if it's a player's entity
|
//but only if it's a player's entity
|
||||||
realm.updateMacroData(spawnPoint);
|
realm.updateMacroData(spawnPoint);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user