CPU leak!

Blitz3D Forums/Blitz3D Programming/CPU leak!

Neochrome(Posted 2005) [#1]
its bugging me, because i cant seem to work out why each time i load a batch of pivots and clear them after im finished with them, the cpu usage goes up by 1 or 2 %. i have gone over the code, im sure its my fault, but i cant track this problem down, Is their anyway i can view ALL objects inside the 3D hardward from blitz?


Banshee(Posted 2005) [#2]
I dont know of a way to do that with the Blitz command set but...

what if you, independantly from all your game data, created a data type that kept track of the pivots by replacing the createpivot() and freeentity() commands?

Type pivot
	Field mem
End Type

Function makePivot()
	entity.pivot=New pivot
	entity\mem=CreatePivot()
	Return entity\mem
End Function
Function freePivot(mem)
	For entity.pivot=Each pivot
		If entity\mem=mem
			FreeEntity mem
			Delete entity
			entity.pivot=Last pivot
		EndIf
	Next
End Function
Function flushPivots()
	For entity.pivot=Each pivot
		FreeEntity entity\mem
		Delete entity
	Next
End Function



Neochrome(Posted 2005) [#3]
i tried something like this, i was hoping that i could peek into the memory on the video card, the game is big enough to get lost in code :( although its only 1% per new stage. do i realy need to worry about it?

not everyone is going to play 24-7 are they? hehe (bad response, but im slowly running out of options)


Hotcakes(Posted 2005) [#4]
Wasn't there a ClearWorld or something similar function that destroyed all entities automatically?


Neochrome(Posted 2005) [#5]
i didn't want to clearworld, it will clear ALL the other 3D Pages and reusable icons, i dont want to load them up all the time... its ok, i think i'll work it out sometime

thanks for the help :)


IPete2(Posted 2005) [#6]
How about making cube meshes along with your pivots are and then deleting these along with the pivots to see if any are left by accident - causing a leak?

IPete2.


Neochrome(Posted 2005) [#7]
i think i sorted it. IPete2 I did use cubes thats how i was able to clear a massive CPU leak earlier, but i was still having a slight problem with it


IPete2(Posted 2005) [#8]
Okay Neo,

I hope you've managed to sort it now!

IPete2.