English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 07 May 2020, 18:39   #1
digitalwarfare
Registered User

 
Join Date: Jan 2020
Location: Farnham
Posts: 15
Kickstart 3.1 vs 1.3 - Garbage Collection

I have a little bit of code, Iv written, that uses os libraries. When I run it on kickstart 3.1 / wb 3.1, when it finishes, it releases all the memory it was using, but when I run it under kickstart 1.3 / Wb 1.3.2, it releases all the memory EXCEPT for 304 bytes of memory, per execution. is this normal under older version of the os? is it just an early os bug, or is it likely to be my code? Its just a simple bit of code I am experimenting with. nothing specific I'm doing
digitalwarfare is offline  
Old 07 May 2020, 19:57   #2
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,003
I would first suspect my program. The OS usually does not leak memory unless you forget to free a resource.
thomas is offline  
Old 07 May 2020, 20:55   #3
Exodous
Registered User

 
Join Date: Sep 2019
Location: Leicester / England
Posts: 48
Is it possible on KS1.3 it's loading a library or initialising something that hasn't been initialised/loaded before and that's what you're seeing as the memory leak.

Run it once, quit, check the memory and then run it again quit and check the memory again. Is it still losing 304 bytes? EDIT: ignore this as I missed the "per execution" bit above.

Are you running it from the CLI or Workbench - if WB, are you correctly dealing with the WB messages?

Are you using your own startup/exit routines or some from a pre-built library that you're linking to? If it's not yours, just try with a program that just exits and doesn't do anything else and see if you have the leak.
Exodous is offline  
Old 07 May 2020, 21:13   #4
digitalwarfare
Registered User

 
Join Date: Jan 2020
Location: Farnham
Posts: 15
Quote:
Originally Posted by Exodous View Post
Is it possible on KS1.3 it's loading a library or initialising something that hasn't been initialised/loaded before and that's what you're seeing as the memory leak.

Run it once, quit, check the memory and then run it again quit and check the memory again. Is it still losing 304 bytes? EDIT: ignore this as I missed the "per execution" bit above.

Are you running it from the CLI or Workbench - if WB, are you correctly dealing with the WB messages?

Are you using your own startup/exit routines or some from a pre-built library that you're linking to? If it's not yours, just try with a program that just exits and doesn't do anything else and see if you have the leak.
Its only a very simple bit of code, as Im just playing with it. Under 1.3 its definitely not returning 304 bytes.

All id does it beep the screen 10 times, once per second. I wanted to make sure I was using the Delay correctly, without tying up the rest of the system. I just noticed this anomaly


Code:
	Include /system
	Include exec/exec_lib.i
	Include exec/exec.i
	Include intuition/intuition.i
	Include intuition/intuition_lib.i
	Include dos/dos.i

	
Startup

OpenDos
	lea 		dosname(pc),a1
	moveq 		#0,d0
	CALLEXEC 	OpenLibrary
	tst.l		d0
	beq		Exit
	move.l  	d0,_Dosbase
	
OpenInt
	lea 		intname(pc),a1
	moveq		#0,d0
	CALLEXEC	OpenLibrary
	tst.l 		d0
	beq		CloseDos
	move.l		d0,_Intbase
	
Main
	move.l		#$09,D0			;Do the Following 10 times
.Loop
	lea		DoBeep(pc),a6		;Beep the Screen
	jsr (a6)
	lea		DoWait(pc),a6		;Wait 1 Second
	jsr (a6)
	dbra 		D0,.Loop
	
CloseInt
	move.l		_Intbase(pc),a1
	CALLEXEC	CloseLibrary
	
CloseDos
	move.l		_Dosbase(pc),a1
	CALLEXEC	CloseLibrary
	

Exit
	rts

DoBeep

	move.l		A0,-(SP)
	move.l		A6,-(SP)
	move.l		D0,-(SP)
	movea.l 	#$0,A0
	move.l		_Intbase,A6
	jsr		_LVODisplayBeep(A6)
	move.l		(sp)+,D0
	move.l		(SP)+,A6
	move.l		(SP)+,A0
	
	rts

DoWait
	move.l 		D0,-(SP)
	move.l		A6,-(SP)
	Move.l		#50,D1
	move.l		_Dosbase,A6
	jsr		_LVODelay(A6)
	move.l		(SP)+,A6
	move.l		(SP)+,D0
	rts	
	
*Variables for strings
dosname		DOSNAME
intname		INTNAME
*Variables for Lib bases
_Dosbase	dc.l 0
_Intbase	dc.l 0
digitalwarfare is offline  
Old 07 May 2020, 23:15   #5
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,003
For me it does not leak any memory on 1.3.
thomas is offline  
Old 07 May 2020, 23:50   #6
digitalwarfare
Registered User

 
Join Date: Jan 2020
Location: Farnham
Posts: 15
Quote:
Originally Posted by thomas View Post
For me it does not leak any memory on 1.3.
strange. Ill run it on a real amiga in a min. I wasn't sure if I had done somthing incorrectly, when closing libs. Im only on like day 3 or 4 of this. trying to get good habits to begin with Iv read quite a few documents, on what should and shouldn't be done. That's why I'm here asking lots of questions, and probably annoying people . I'm going to have many many more questions, some of them pretty stupid ones too ....... Thanks for putting up with me
digitalwarfare is offline  
Old 08 May 2020, 03:58   #7
ma693541
Computer Wizard

ma693541's Avatar
 
Join Date: Aug 2007
Location: Ramberg/Norway
Posts: 721
What kind of assembler do you use? SEKA? Wish I had my SEKA assembler book now, don't remember the exact name of it, but it was used SEKA as assembler for the examples.
ma693541 is offline  
Old 08 May 2020, 07:50   #8
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 47
Posts: 3,799
In this kind of situation i would comment out everything except the final rts, and then bring back the elements one by one to find the culprit.
meynaf is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Garbage on screen during boot absence Coders. General 6 20 February 2011 20:28
Wanted >> Amiga Virus Free PD Collection & Fred Fish Collection Kitty request.Demos 34 06 January 2006 20:30

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:13.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.12210 seconds with 14 queries