22 May 2014, 01:40 | #1 |
Registered User
Join Date: Sep 2013
Location: Bettendorf, IA, USA
Age: 52
Posts: 204
|
Eat memory
This is a new one to me.
I start my program, from Shell or Workbench, all is good. I start another copy. As soon as the window is opened it eats 1.5MB of RAM for no reason. I close either copy, it is released. If I open multiple copies, each one uses 1.5MB again. When I close one, it releases the 1.5MB. When get down to the last window, of any copy, it is back to the "normal" 140KB used RAM. Only the second and higher copy causes the memory usage. First copy is fine. I have been using this code since "back in the day" Code:
BOOL SAK_SegmentSplit(STRPTR CommandName,STRPTR Name,BYTE Pri,LONG StackSize,APTR Function) { struct Process *Child, *Me; struct CommandLineInterface *CLI; Me=(struct Process *)FindTask(NULL); if (Me->pr_CLI) { CLI=(struct CommandLineInterface *)BADDR(Me->pr_CLI); Forbid(); if (Child=CreateNewProcTags( NP_CommandName, CommandName, NP_Name, Name, NP_Priority, Pri, NP_StackSize, StackSize, NP_Entry, Function, NP_Cli, TRUE, NP_ExitCode, (VOID (*)())SAK_ProcessCleanup, NP_ExitData, CLI->cli_Module, TAG_DONE)) CLI->cli_Module=NULL; else { Permit(); Printf("\x1B[1m%s:\x1B[0m Failed to create new process!\a\n",CommandName); return(FALSE); } Permit(); } return(TRUE); } |
22 May 2014, 14:38 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Attached code looks fine (EDIT: but also too much code is not included), clearing cli_Module is quite common method to prevent executable memory deallocation when it exits.
Last edited by Toni Wilen; 22 May 2014 at 17:00. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[FOUND] We Eat Lamers for Breakfast | Leffmann | request.Demos | 3 | 30 January 2012 12:21 |
Eat a Log, best Amiga game ever... | s2325 | Retrogaming General Discussion | 4 | 11 April 2011 10:02 |
listing my drawer games eat my chipmem ! | Foul | support.Other | 19 | 09 April 2010 19:29 |
Eat the Whistle ECS/OCS ? | lolafg | request.Old Rare Games | 11 | 11 June 2009 08:18 |
Eat the Whistle GPL | Nyarlathotep | Amiga scene | 1 | 19 September 2003 22:50 |
|
|