Hello everyone:
Am having a memory leak on a very simple piece of code that needs to run for several hours at a time. when I run the code and watch the task manager as it runs, my PF Usage rises slowly and steadily.
What I am trying to do is have 4 letters, G, A, T, and C randomly cycle, sort of like a counter. It works like I want it to, except for the leak. I am doing it by randomly loading little image files, but if there is a more efficient way to do this, I would love to know as well.
Here is the code:
+++++++++++++++++++++++++++++++++++++++
Graphics 640,480,16
SetBuffer BackBuffer()
SeedRnd MilliSecs()
;outTimer = MilliSecs() + (10000)
;Global TimerState = 0
While Not KeyHit(1)
;If MilliSecs > outTimer
; outTimer = MilliSecs() + (10000)
; TimerState = 1
; If TimerState = 1
; Outcome=LoadImage ("outcome_" + Rand(1,10) + ".png")
; DrawImage Outcome,180,100
; FreeImage Outcome
; outTimer = MilliSecs() + (10000)
; ;TimerState = 0
; Else TimerState = 0
; EndIf
;EndIf
DNA=LoadImage ("GTAC_" + Rand(1,4) + ".png")
ScaleImage DNA,1.2,1.2
DrawImage DNA,100,100
;Delay 150
FreeImage DNA
Flip
DNA1=LoadImage ("GTAC_" + Rand(1,4) + ".png")
ScaleImage DNA1,1.2,1.2
DrawImage DNA1,132,100
;Delay 90
FreeImage DNA1
Flip
DNA2=LoadImage ("GTAC_" + Rand(1,4) + ".png")
ScaleImage DNA2,1.2,1.2
DrawImage DNA2,116,100
;Delay 120
FreeImage DNA2
Flip
DNA3=LoadImage ("GTAC_" + Rand(1,4) + ".png")
ScaleImage DNA3,1.2,1.2
DrawImage DNA3,148,100
;Delay 100
FreeImage DNA3
Flip
Cls
Equals=LoadImage ("equals.png")
MaskImage Equals,255,255,255
DrawImage Equals,164,102
;Cls
Wend
End
++++++++++++++++++++++++++++++++++++
Am having a memory leak on a very simple piece of code that needs to run for several hours at a time. when I run the code and watch the task manager as it runs, my PF Usage rises slowly and steadily.
What I am trying to do is have 4 letters, G, A, T, and C randomly cycle, sort of like a counter. It works like I want it to, except for the leak. I am doing it by randomly loading little image files, but if there is a more efficient way to do this, I would love to know as well.
Here is the code:
+++++++++++++++++++++++++++++++++++++++
Graphics 640,480,16
SetBuffer BackBuffer()
SeedRnd MilliSecs()
;outTimer = MilliSecs() + (10000)
;Global TimerState = 0
While Not KeyHit(1)
;If MilliSecs > outTimer
; outTimer = MilliSecs() + (10000)
; TimerState = 1
; If TimerState = 1
; Outcome=LoadImage ("outcome_" + Rand(1,10) + ".png")
; DrawImage Outcome,180,100
; FreeImage Outcome
; outTimer = MilliSecs() + (10000)
; ;TimerState = 0
; Else TimerState = 0
; EndIf
;EndIf
DNA=LoadImage ("GTAC_" + Rand(1,4) + ".png")
ScaleImage DNA,1.2,1.2
DrawImage DNA,100,100
;Delay 150
FreeImage DNA
Flip
DNA1=LoadImage ("GTAC_" + Rand(1,4) + ".png")
ScaleImage DNA1,1.2,1.2
DrawImage DNA1,132,100
;Delay 90
FreeImage DNA1
Flip
DNA2=LoadImage ("GTAC_" + Rand(1,4) + ".png")
ScaleImage DNA2,1.2,1.2
DrawImage DNA2,116,100
;Delay 120
FreeImage DNA2
Flip
DNA3=LoadImage ("GTAC_" + Rand(1,4) + ".png")
ScaleImage DNA3,1.2,1.2
DrawImage DNA3,148,100
;Delay 100
FreeImage DNA3
Flip
Cls
Equals=LoadImage ("equals.png")
MaskImage Equals,255,255,255
DrawImage Equals,164,102
;Cls
Wend
End
++++++++++++++++++++++++++++++++++++