Oberon Community Platform Forum
December 14, 2019, 05:24:10 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Command to show what Mods I should unload  (Read 3751 times)
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« on: August 02, 2010, 10:40:09 PM »

Is there a command that would give me a list of Modules which I've loaded, that need to be unloaded? I notice that after awhile the system becomes sluggish.
Logged

duke
staubesv
Administrator
Sr. Member
*****
Posts: 387



« Reply #1 on: August 03, 2010, 08:48:16 AM »

SystemTools.ListModules ~ shows a list of all loaded modules
SystemTools.WhoImports ModuleName ~ shows a list of all modules that directly or indirectly import the specified module
SystemTools.FreeDown ModuleName ~ unloads the module ModuleName and all modules that directly or indirectly import it (be warned: this can be dangerous!)

Quote
I notice that after awhile the system becomes sluggish.
This can happen if there are many many alive objects on the heap that stress the garbage collector too much... Have a look at the memory usage using WMPerfMon.Open ~
Logged
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« Reply #2 on: August 03, 2010, 02:21:53 PM »

SystemTools.ListModules ~ shows a list of all loaded modules
SystemTools.WhoImports ModuleName ~ shows a list of all modules that directly or indirectly import the specified module
SystemTools.FreeDown ModuleName ~ unloads the module ModuleName and all modules that directly or indirectly import it (be warned: this can be dangerous!)

I should make myself a "menu" with all these important "maintenance" commands ...
Is there a simple way to do that?

Quote
Quote
I notice that after awhile the system becomes sluggish.
This can happen if there are many many alive objects on the heap that stress the garbage collector too much... Have a look at the memory usage using WMPerfMon.Open ~

By "alive objects", do you mean Modules that have not had SystemTools.Free applied to them - like Notepad, PET, FileManager, etc?

When I shit down an application - say PET - by , does that not so a "

Does clicking on the red button at the top-right corner to shut down an app - e.g. PET - not call SystemTools.Free <module> automatically?
Logged

duke
staubesv
Administrator
Sr. Member
*****
Posts: 387



« Reply #3 on: August 03, 2010, 02:43:53 PM »

Quote
Is there a simple way to do that?

There are several simple ways...

- Write a text file containing the commands (simplest). Hint: The "default" command interpreter (WMTextView) will replace the ^ character in the command arguments by the most recently selected text, so SystemTools.FreeDownTo ^ ~ is useful...
- Use desktop icons (see WMDesktopIcons.Mod, essentially an icon where you can associate a command). Place the icons on the desktop and press Main Menu -> System -> Save Desktop
- Add entries to main menu (see MenuPageXX.XML where XX=00, 10, 20, ...)
Logged
staubesv
Administrator
Sr. Member
*****
Posts: 387



« Reply #4 on: August 03, 2010, 02:51:47 PM »

Alive Objects: Objects that can be reached from the root set (via global variables, stacks or registers). This means that some code could access the objects and therefore, they are not collected by the garbage collector.

Closing a window does not unload any modules. This is, however, not an issue since loaded modules do not consume much memory or other resources (unless there are global variables that keep objects alive)- there is no need to unload the module PET when you close all PET windows.

There may be modules that do have global variables that reference objects and keep them alive, but this is actually a program error and should be fixed.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!