FavMenu 2.0

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Memory story:

majestic @ Totalcmd.net
7MB memory usage?
Gigantic for such app

majkinetor @ Totalcmd.net
It doesn't use more then 3.5MB here.

majkinetor @ Totalcmd.net
OK, majestic you were right
It uses about 7MB of memory until it is Reloaded (from the tray menu). After that it drops to 2.5-3.5MB, so it is good advice to reload it after starting it. I might add this programaticaly.

This is some Windows unknown behavior. Reloading will execute another instance of AHK and close the prvious one, just like you open another FavMenu and closed previous after that. Why does that cuts the memory to half you will have to ask MS support :)

Also, you have to consider that this is a script (exe version is compiled AHK script). THerefore, it can not have the same minimal performance like it would be in C language. AHK by my knowledge outperformed all other scripting languages, so I guess it can not be better then this.


majkinetor @ AHK
I noticed that when you run any script for the first time, it eats much more memory then after you Reload it via internal command.

I tried on several different scripts and behavior is the same: Used memory is cut to half.

This is very strange behavior since Reload will spawn another AHK process and close itself so I don't know how that differs from cold start


Chris @ AHK
It could be that Reload results in less memory shown because the second instance shares memory (system resources) with the first instance.

If you're using Task Manager to gather these memory statisitcs, I don't think its "Mem Usage" column is an accurate reflection of how much memory a process has actually consumed. For details, see http://www.autohotkey.com/forum/viewtopic.php?p=24247#24247

I am using TaskInfo & PRocess Explorer. Both report the same.

majkinetor @ AHK
Must be some weird Windows behavior.
This is info from running my FavMenu script (used as merging example). This script is big but it does nothing on startup except checking for few config enteries in ini file. Then it waits for the hotkey to do the work. I just launch (without hotkey call) and then reloaded. This is what I got:
Code:

Code: Select all

Physical Memory   |   First Run   |   Reloaded 
------------------------------------------------------------------ 
Working Set       |   5.324       |   2.512 
WS Private        |   2.452       |   1.668 
WS Shareable      |   2.872       |   844 
WS Shared         |   2.824       |   836 
Peek              |   5.324       |   4.504
Chris @ AHK

I checked the code and there isn't very much different between reload-mode and normal mode.

Rather than using "Working Set", perhaps it would be more accurate to use "VM Size" as shown by Task Manager.

majkinetor @ Totalcmd.net
After longer analysies of memory problem this is to take as a final note about it:

It is determinted by several other excellent programmers and me, that even the smallest windows application consume about 5MB of memory. We did examples in Watcom compiler (the litest of C compilers) creating 5KB exe files that do nothing. TaskManager reported 5MB MEM usage. It appears to be some internal memory alocation to handle security attributes, users rights or whatsoever, in any case, memory reported is not accurate. Favmenu itself uses about 30KB memory internaly and AutoHotKey scripting language according to my talk with the author eats memory far far from 5MB. Also system dll-s are counted, so Favmenu uses 2.5MB when first run and 1.6 MB when reloaded

So, it appears to be false alarm...

You can ofcourse see processes in TaskManager that eat as low as 0.5MB RAM, but those are services or system drivers witch have entirely different SDK then normal windows application.
Windows Explorer itself is eating 25MB RAM here without any addons, witch is "Gigantic" for such app :)
Last edited by majkinetor ! on 2006-09-18, 09:23 UTC, edited 1 time in total.
Habemus majkam!
User avatar
gbo
Senior Member
Senior Member
Posts: 329
Joined: 2005-03-31, 19:58 UTC
Location: Lausanne (Switzerland)

Post by *gbo »

I receive an error screen when using favmenu2 (2.0 beta7) this error is due to icon.

After some investigation I noticed that it only happens with 'root' menu and only if the menu is 3 digits (2 digits works fine)

Exemple:
menu107=Websites
cmd107=cd e:\Websites
icon107=C:\Program Files\Totalcmd\icons\12x12\recurse-blue.ico

Can someone confirm ?
Gil
Licence #17346

90% of coding is debugging. The other 10% is writing bugs.
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Hm.... I must check it out....
I get that error when I click on the tray too fast :)
But 2digit, 3digit... it should not be a problem. Check for holes in you menu (missing numbers)

Send me your menu after you check.
Habemus majkam!
User avatar
gbo
Senior Member
Senior Member
Posts: 329
Joined: 2005-03-31, 19:58 UTC
Location: Lausanne (Switzerland)

Post by *gbo »

I found the cause of the problem. It was due to a duplicate entry (menu and entry having the same name).

menu3=Program Files
cmd3=cd C:\Program Files
icon3=C:\Program Files\Totalcmd\icons\12x12\box-blue.ico

menu28=-Program Files

To solve the issue it was only necessary to rename (F2) the menu3 to
menu3=Program Files [add pseudospace (Alt 0160) at the end of the title]
Gil
Licence #17346

90% of coding is debugging. The other 10% is writing bugs.
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

I am glad it is this.
May be hard to find it with long menus, but that is only limited for the same submenu, that is, you can have same enteries in different submenus.

This is even happening whit items of different type, like in your case.

I like to create menus like:

menu28=-Program Files
menu29=Program Files
cmd29 = cd c:\program files
menu30 = -

menu31.....

This is my workaround for not being able to click on the submenu item itself, like you sugested once.


I sese Gbo that you have big menu. I hope that speed of the menu is not of big concern for you now, since it is refreshed every time. I just want to inform you that I am currently improving this with smart refreshing, so even extremely big menus (the guy with 200 menu items contacted me) will be shown imediately (<=50ms), contrary to now, when large menus take almost 1s to load.
Habemus majkam!
User avatar
gbo
Senior Member
Senior Member
Posts: 329
Joined: 2005-03-31, 19:58 UTC
Location: Lausanne (Switzerland)

Post by *gbo »

majkinetor ! wrote: I like to create menus like:

menu28=-Program Files
menu29=Program Files
cmd29 = cd c:\program files
menu30 = -

menu31.....

This is my workaround for not being able to click on the submenu item itself, like you sugested once.
So do I for submenu that I often need
majkinetor ! wrote: I sese Gbo that you have big menu. I hope that speed of the menu is not of big concern for you now, since it is refreshed every time. I just want to inform you that I am currently improving this with smart refreshing, so even extremely big menus (the guy with 200 menu items contacted me) will be shown imediately (<=50ms), contrary to now, when large menus take almost 1s to load.
In fact I am now up to menu 173 and it will grew up as soon as I find time to extend it that is why I like icons to quickly find what I am looking for. I will say it takes 0.5 sec for the menu to appear which is quite acceptable for me although I am not against <=50ms :D

Thanks for your concerns

[OT]
Concerning FTP user name & password in menu command.
Just want to point out that if you need sftp instead of FTP and your are using this plugin
http://sftp4tc.berlios.de/
it already works fine with favmenu2 (with this plugin you can configure a root passwd that has to be entered one time and after you can reach sftp site with favmenu without entering password again)
[/OT]
Gil
Licence #17346

90% of coding is debugging. The other 10% is writing bugs.
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Thx Gbo, I will keep that SFTP plug in mind.

Currently I only want to achive some compatibility with TC since this and internal commands are only breakers for now. Internal command will be added soon (like cm_opendrives) and I will see to do something about FTP.

Ah yeah.. and target field. I intentiously left that untouched, since I used this feature maybe once in a lifetime and only 1 man asked this so far... It also doesn't make any sense with dialogs.
Habemus majkam!
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

I think I though out the best solution for refreshing, instantious without checking the ini on every call.

The refreshing was added during the time when Editor wasn't yet created so you had to use TC's editor (OMG) to do the thing or some alternative editors available. Now non of them are recommended to use with Favmenu since they are not aware of icons and will delete them. Also I hooked double click on TC's "current directory" header (I will probably add hook to [*] button soon ).

So, I can now decide to refresh menu only after you use Menu Editor (Changes via "Properties" dialog are updated imediately). Your menu will be refreshed in the background as you finish using Menu Editor so you will never notice any delay when calling the Favmenu.

O yeah.. that is good. It is strange how most obvious solution was hidden behind something that is obsolated....

I wonder though does anybody use other editors with Favmenu.....


Check out the new hot place here
Habemus majkam!
TealC
Junior Member
Junior Member
Posts: 96
Joined: 2005-08-10, 11:34 UTC

Post by *TealC »

majkinetor ! wrote: The refreshing was added during the time when Editor wasn't yet created so you had to use TC's editor (OMG) to do the thing or some alternative editors available. Now non of them are recommended to use with Favmenu since they are not aware of icons and will delete them.

I wonder though does anybody use other editors with Favmenu.....
i actually use tcs editor, just by habit... but since i don't want no icons in my favmenu, that's no problem for me. And if it speeds up the displaying of the menu, i want it as soon as possible :wink:
Because here at work, my computer is not the fastest one, which results in a delay of ~0.7 seconds, which is really annoying...
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

but since i don't want no icons in my favmenu, that's no problem for me.
It is a problem. I choosed to refresh favmenu upon usage of Menu Editor. When you finish using it, it will broadcast the message that Favmenu will catch if active and refrsh itself in the background. So no dalay will ever be possible.

If you use other editor this will not happen and you will have to Reload Favmenu from the tray.
Habemus majkam!
TealC
Junior Member
Junior Member
Posts: 96
Joined: 2005-08-10, 11:34 UTC

Post by *TealC »

majkinetor ! wrote:
but since i don't want no icons in my favmenu, that's no problem for me.
It is a problem. I choosed to refresh favmenu upon usage of Menu Editor. When you finish using it, it will broadcast the message that Favmenu will catch if active and refrsh itself in the background. So no dalay will ever be possible.

If you use other editor this will not happen and you will have to Reload Favmenu from the tray.
i'm well aware of that. i just wanted to say, that if there's a speed improvement, bring it on! :wink:
The functionality which is lost is no problem for me because i edit my favmenu once a month or so, and i don't mind restarting the script once in a month. if it gets more frequently, i will use your editor. but because you asked who is using another editor, i said i am, becaus i am using it...
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

OK TealC

thanx for answering.
Habemus majkam!
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

I think there was enough testing so I uploaded to totalcmd.net

Nothing is changed from beta7
Habemus majkam!
User avatar
gbo
Senior Member
Senior Member
Posts: 329
Joined: 2005-03-31, 19:58 UTC
Location: Lausanne (Switzerland)

Post by *gbo »

New feature request :

FavMenu2 records the current column view when 'add current dir' and obviously select this 'column view' when the entry is requested.

What do you thing? is it possible?

As an alternative if it is feasable but that you don't plan to add this feature could you explain to me how and where to implement that in your script ?

TIA
Gil
Licence #17346

90% of coding is debugging. The other 10% is writing bugs.
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

hm....
That is indeed very good idea... we asked for this hundreed of times.

It is not trivial to integrate that into Favmenu since you wuld have to make changes on 3 places. That said, it is not so complicated and possibly can be done.

That can be done using:
[_Load custom column views directly_]=0
cm_SrcCustomView1=271; Source: Custom columns 1
cm_SrcCustomView2=272; (user defined columns)
cm_SrcCustomView3=273; etc.
cm_SrcCustomView4=274;
..
cm_SrcCustomView9=279; etc. until 299
cm_LeftCustomView1=71; Left: Custom columns 1
cm_LeftCustomView2=72; (user defined columns)
cm_LeftCustomView3=73; etc.
cm_LeftCustomView4=74;
...
cm_RightCustomView1=171; Right: Custom columns 1
cm_RightCustomView2=172; (user defined columns)
cm_RightCustomView3=173; etc.

OMG, Ghisler is such a n00b... He created 30 commands in place of 1.

Anyway, it just happened I have briliant idea about this.
I can for instance set to execute custom TC command upon switching folder... so you can place whatever you like, among other things column view. You would have to edit this yourself. I don't know is there any easy way to recognise currently selected view. Maybe INI thought... SheepDog?

I will add this in TO DO list since I like the idea and I myself asked Ghisler number of times for this

However, I can't promisse some specific time. I think that time for smarter refreshing has come and I didn't implement it yet since I remember that there was some problems with it from the very beginning. AHK is very primitve language, in C this would be over in several hours. Also, Chris @ AHK mention that menu command will be soon changed to the way that will allow me to refresh menu without any problems.

Thanx gbo, your ideas are good.
Habemus majkam!
Post Reply