Memory Usage

Blitz3D Forums/Blitz3D Beginners Area/Memory Usage

Heres what i'm doing when a new stream connects, and this is it:

Function checknew()
stream=AcceptTCPStream(server)
If stream Then
Print "*CONNECTION RECIEVED!*"
ucount#=ucount#+1
x=ucount#
pl (x)=New Player
pl (x)\name$="Logon........................................................................................."
pl (x)\stream=stream
pl (x)\status=Menu
pl (x)\prace$="None"
pl (x)\pclass$="None"
pl(x)\sex$="None"
pl (x)\comm1$=""
pl (x)\comm2$=""
pl (x)\comm3$=""
pl (x)\comm4$=""
pl (x)\msg$=""
pl (x)\comm=1
pl (x)\PlayerId=x
displaymenu pl(x)
end function

and when i delete the players this is what i'm using:

function Logoff(p.player)
If p\status=playing deletealsohere p
If Not Eof(p\stream)
Deletealsohere p
Print p\name$+" has logged off!"
WriteLine p\stream, "GOODBYE!...come back soon!"
CloseTCPStream(p\stream)
EndIf
jhk=p\playerID
;Print "player id deleteing: "+jhk
For x=1 To ucount# Step 1
If pl(x)\playerid>jhk Then
k=x-1
stream=pl(x)\stream
pl (k)\stream=stream
;Print "player_id"+pl(x)\playerID+" larger Then A!="+a
pl(k)\playerid=pl(x)\PlayerId-1
pl(k)\status=pl(x)\status
pl(k)\level=pl(x)\level
pl(k)\name$=pl(x)\name$
pl(k)\password$=pl(x)\password$
pl(k)\password$=pl(x)\Curr_Area
pl(k)\curr_room=pl(x)\curr_room
pl(k)\title$=pl(x)\title$
pl(k)\pclass$=pl(x)\pclass$
pl(k)\prace$=pl(x)\prace$
pl(k)\pracenumber=pl(x)\pracenumber ;?
pl(k)\pclassnumber=pl(x)\pclassnumber;?
pl(k)\sex$=pl(x)\sex$
pl(k)\comm=pl(x)\comm
pl(k)\experience#=pl(x)\experience#
pl(k)\baseexp#=pl(x)\baseexp#
pl(k)\exptnl#=pl(x)\exptnl#
EndIf
Next
Print "Deleting player# "+ucount#
Delete pl(ucount#)
If ucount#=<1 Then
For px.player=Each player
Print px\playerid
Next
EndIf
ucount#=ucount#-1
end function