PDA

View Full Version : SlimTray.exe unresponsive and huge



MrSinatra
2007-01-30, 10:42
for some reason, when i went to start SS from the system tray, it wouldn't respond, no left or right click.

so, i brought up task manager and its a whopping 67,924K and climbing incrementally.

end process did kill it np, and it restarted np.

any idea why this happened?

also any idea why slimtray is currently using some 13+ megs? it does very little imo, thats pretty bloated.

JJZolx
2007-01-30, 11:43
for some reason, when i went to start SS from the system tray, it wouldn't respond, no left or right click.

so, i brought up task manager and its a whopping 67,924K and climbing incrementally.

end process did kill it np, and it restarted np.

any idea why this happened?

68MB is fairly standard. I've seen mine range anywhere from 35MB to as much as 100MB, but it tends to rise and fall a little. SlimServer seems to keep huge amounts of data in memory. Plugins are also kept in memory, so the more plugins you activate, the more memory is used. Also, I've encountered a number of poorly written plugins that are bad about releasing memory.


also any idea why slimtray is currently using some 13+ megs? it does very little imo, thats pretty bloated.

SlimTray is written in Perl and uses the same ActiveState method to create an EXE - bundling the complete Perl interpreter into the application itself. You're right, it does very little, but I'm surprised it's that small.

SteveEast
2007-01-30, 11:56
My slimtray.exe (6.5.1 release) is currently just under 7MB, with a peak of 12MB.

Steve.

MrSinatra
2007-01-30, 12:27
sorry, i wasn't clear...

taskmgr was saying it was the " SlimTray.exe " that had reached 68megs!

normally, my Slim.exe is around 77-89megs.

i think 13meg for slimtray is bloated, but 68megs, climbing, and unresponsive? it doesn't happen often, but it does happen.

JJZolx
2007-01-30, 12:51
i think 13meg for slimtray is bloated

I agree. I imagine something written in C for Windows would be a few hundred kilobytes.


but 68megs, climbing, and unresponsive? it doesn't happen often, but it does happen.

There were some changes made to SlimTray for 6.5.1. I doubt that they've all been ironed out.

I stopped using SlimTray a while ago. What does it do?

It stops/starts the SlimServer service. That's easily done from the Services manager. If you want a quicker way, create a couple of batch files and place an icon on the desktop or create If you run more than one instance of SlimServer on the server then you'll need to do this anyway, as the service name is hard-coded into SlimTray, so it controls at most one instance.

Batch files:

@echo off
REM Stop SlimServer service
net stop slimsvc

@echo off
REM Start SlimServer service
net start slimsvc

And SlimTray also links to the home page of the web ui. So put a bookmark in your browser. Or create a shortcut and place it in the Start menu.

That's pretty much all that this 7-13 MB application does.

MrSinatra
2007-01-30, 13:01
those are good workarounds... but i probably will just stick with ST, since i do find i look a lot to see if the green (or blue?) color is there to show if SS is started or not. (i don't start it automatically)

i guess that means i'm prepared to live with the 13megs, but my concern was that i didn't want to see it start having issues, becoming unresponsive and bloated.

in fact, i don't understand why they'd write it in perl, and include a perl interpreter for it in the app to begin with... whats the point of being "cross platform" for this app, [ST] when it only works with windows anyway, (right?)

MrSinatra
2007-01-30, 13:04
and btw, if i start SS from the ST, and it then ALSO starts the mysql process, i fully believe that when i STOP SS from the ST, it should ALSO stop or quit the mysql process, or at least give someone the option to have it behave like that.

Richie
2007-01-30, 13:17
On 30/01/07, MrSinatra
<MrSinatra.2l8oub1170187502 (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> and btw, if i start SS from the ST, and it then ALSO starts the mysql
> process, i fully believe that when i STOP SS from the ST, it should
> ALSO stop or quit the mysql process, or at least give someone the
> option to have it behave like that.

On my 6.5.1 it does. It can take 15-20 seconds for the MySQL service
to unload though.

Richard

MrSinatra
2007-01-30, 14:26
it never has quit for me, although i've only been using nightlies since before thanksgiving i think.

i just tried it now, it ain't quittin. sits there at ~18megs, while ST is ~14, and slim not present)

are you using XP sp2 and the "official" 6.5.1 release?

Richie
2007-01-30, 16:05
> are you using XP sp2 and the "official" 6.5.1 release?
>

Yes to both. I just tried it again and timed it at approx. 3 seconds.

Richard

MrSinatra
2007-02-04, 23:57
i just put the nightly on, and mysqld still isn't quitting after i exit slim.exe from the slimtray icon.

should i file a bug report for that?

Graham
2007-02-13, 14:32
Looking at the windows task manager, my slimtray.exe is accruing a massive number of file handles over time. It steadily ramps up, with perhaps 100,000 over the day. Nothing bad seems to result from this, but it's clearly not right. This is true for both the current stable slimserver install and the nightly builds. Does anyone else see this?

Mysqld has a steady 4382 handles, slim.exe a measly 107.

MrSinatra
2007-02-13, 14:44
how do i check file handles? i don't know how.

i think eventually, a growing app that doesn't release resources will if left unchecked, lock up ones system.

bergek
2007-02-13, 14:48
Bring up the task manager (Ctrl+Shift+Esc) and choose "Select Columns..." from the View menu. Then check the Handles option and press OK.

MrSinatra
2007-02-13, 15:01
ok, since i rebooted late last night, slimtray has held steady at 13megs, which i think is too high, but i'll live with it.

but the handles are at 262,312! and its growing steadily...

what does this mean? how can it grow but the mem size stay relatively the same?

Graham
2007-02-13, 15:17
My simplistic understanding is that, roughly, handle=file, so slimtray seems to be opening files but not closing them. It certainly looks like a bug.

bergek
2007-02-13, 16:40
Actually more or less everything in Windows is represented by handles - windows, threads, semaphores, registry operations, resources etc. And, of course, files.

If you want to see what kind of handles Slimtray.exe keeps open I recommend the free application Process Explorer from www.sysinternals.com.

MrSinatra
2007-02-13, 19:01
320,084 handles and counting.

filed two bugs:

http://bugs.slimdevices.com/show_bug.cgi?id=4762

http://bugs.slimdevices.com/show_bug.cgi?id=4763

please vote for them!

Mark Lanctot
2007-02-14, 07:24
This must be something particular to certain setups. In my case:

mysqld.exe: 4388 handles, 6708 K mem usage
slim.exe: 119 handles, 70 524 K mem
slimtray.exe: 89 handles, 5164 K mem

Graham
2007-02-14, 09:35
For me, slimtray is gaining exactly 49 handles every 10 seconds. Perhaps that is a clue.

MrSinatra
2007-02-15, 23:59
i had a thought... perhaps it happens to those users who don't start SS automatically...

haven't the time to try now, but wanted to jot this idea down b4 i forgot it.

Mark Lanctot
2007-02-16, 15:30
Maybe - I do start it automatically.

Simonfish
2007-02-21, 00:36
320,084 handles and counting.

filed two bugs:
http://bugs.slimdevices.com/show_bug.cgi?id=4762
http://bugs.slimdevices.com/show_bug.cgi?id=4763

please vote for them!

I've updated bug 4762 with a bit more information. I went in with a debugger to to see what's going on, and it looks like perl is leaking process handles. If this bug isn't fixed, it will eventually cause your system to stop working in very odd ways, as the kernel runs out of space for handles. If you reboot often, you'll never notice a problem.

MrSinatra
2007-02-21, 11:29
great work...

what i've been doing is just quitting slimtray every so often.

i have to say, i am disappointed in the lack of response either of my bugs has gotten from SD. maybe your grunt work will prod them along.

Simonfish
2007-02-21, 15:49
Turns out that the problem is probably in the implementation of perl used by SlimTray. Slim can't do anything to fix that bug, so I would recommend not running SlimTray if you plan on leaving your machine running without rebooting for more than a day or so.

MrSinatra
2007-02-21, 16:10
well, wait a minute...

it seems to me that thats a bad answer as a long term plan.

surely, if they want people to have slimtray, that have to offer a slimtray that isn't leaky?

if the whole perl interpreter is in the exe itself as jim suggests, why not use a version of perl that isn't deficient?

or better yet, since slim tray is for windows only anyway, why not just write it in C and get it over with?

this is slimtray, not SS, why stick with a bloated leaky perl?

JJZolx
2007-02-21, 21:26
Turns out that the problem is probably in the implementation of perl used by SlimTray.

How did you come to that conclusion, rather than it being an issue within SlimTray itself? Was the most recent SlimTray compiled with a different version of ActivPerl than in the past releases, or has this always been a problem?

y360
2007-02-22, 04:52
I can confirm SlimTray is indeed leaking handles

In my case, looking at Windows Task Manager it has reached 1,464,939 handles and is increasing by exactly 80 handles every 10 seconds

I'm running SlimServer Version: 6.5.2 - 11466

oreillymj
2007-02-23, 03:24
I looked through the Slimtray.pl code in subversion and while I'm no perl expert, it's hard to see anything that might be causing a leak.

I also checked it's activity in Filemon & Regmon. It seems to read a few reg key's every few seconds but there are matching closekey entries.

Next step would be to run using perl Slimtray.pl with the reg checks commented out for a few day to see if it fixes the issue.

However on my system, Slimtray is only using ~10Mb.

bpa
2007-02-23, 05:01
It is possible there is an interaction with some other s/w typically the security stuff - Antivirus, Firewall etc.

Some of these packages insert them selves into Windows system calls and don't behave properly. A test on a clean Windows systems may also be useful.

MrSinatra
2007-02-23, 11:32
on my system, slimtray usually holds steady at around 13megs.

however, the handles ALWAYS increase, and do so non-stop.

i do not have anything unusual on my system, as i use the built in XP firewall, windows defender, and AVAST AV. all pretty normal things. (avast is great)

if i had to guess, i would guess this is a SD issue, not a windows one, but i could easily be wrong.

i still don't understand why they stick with perl for slimtray anyway. high time to move that to C, to lessen the load and fix this annoying handles issue.

Marc Sherman
2007-02-23, 11:33
MrSinatra wrote:
>
> i still don't understand why they stick with perl for slimtray anyway.
> high time to move that to C, to lessen the load and fix this annoying
> handles issue.

You keep saying that. Patches are welcome, I'm sure.

- Marc

MrSinatra
2007-02-23, 12:04
and several of you regulars on here always say that. not my job, and i don't code. SD makes and markets the product, the responsibility is theirs, and no i don't want this thread hijacked into another useless debate over the obviousness of what i'm saying.

bpa
2007-02-23, 12:49
There have been a lot of changes in slimtray for 6.5 and since nobody complained of this problem before 6.5 this point to a 6.5 coding issue.

The ActiveState tool for creating system trap apps hasn't changed much in 2 years and many other users are using it without reporting this problem so again it indicates that it is more likely to be user written code problem rather than a faulty ActiveState tool.

So the best we should do is characterise the problem so the bug can be found. It is unfortunate that the tool to create slimtray has to be bought and so it is likely that only the Slimdevices developers will be able to test and fix it unlike other Slimserver bugs.

MrSinatra
2007-02-23, 13:07
actually, my wee quibble with what you say is that i think its a lot more prevalent then you might think, its just most users don't look in task manager, let alone configure it to display handles.

i consider myself a power user, and i hadn't done that til directed to in this thread.

as to the code tool, seems to me to be just another reason to port the app to C, since its just slimtray and windows only by definition.

mherger
2007-02-23, 13:20
> as to the code tool, seems to me to be just another reason to port the
> app to C,

We all know it's easy in C, but we don't know C. Please stop wasting your
time telling us how easy it is and start reading "Learn C in 24 hours".
Contributions are still rewarded. Go ahead!

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

mherger
2007-02-23, 13:30
http://newdata.box.sk/bx/c/ :-)

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

MrSinatra
2007-02-23, 13:34
i just want to be clear on this...

are you saying no one at SD knows C? how about logitech?

and stop pushing the "you go code it angle." i'm not a slim employee, don't ever plan to be, and its an old refrain from you guys that jeopardizes the intent of the thread.

kdf
2007-02-23, 13:35
I see two options:

1) file a bug regarding the handles problem, and allow the
developers/qa to handle it in the queue with everything else.

2) continue to dictate how/when and what language it needs to be done
in, likely resulting in more responses of "patches welcome" until
someone decides it's worth doing it just how you've decided it should
be done.

Both are equally valid when it comes to open source, and both apply to
anyone involved in this thread and many others.

-kdf

bpa
2007-02-23, 13:35
Quite right about wondering how prevalent - that is part of the task of characterising the problem - other questions that need to be answered

Q. Does it affect all Windows XP users or only some users - and if it is not all users what is the common factor.
Q. Is this a new 6.5 problem or was it around in 6.3 and earlier ?
Q. How serious is this problem - does it really cause crashes or other unwanted behaviour and if so what is the timeframe.

I think I may be able to test the 6.3/6.5 question over the weekend.

As to the code tool - I've had plenty of problems with C compilers and support libraries to know that nothing is bug free. Changing code of an existing app to fix a bug is easier than rewriting it in a different language and as yet there is no definitive proof the tools is at fault.

I leave the choice of tool up to the developers - they made an assessment a few years ago and the tools used to develop slimtray are independent of the tools needed for slimserver. There was no legacy code so they had a clean slate and could have chosen C. They are experienced professional developers and so I think they would have assessed the options properly.

Ben Sandee
2007-02-23, 13:36
On 2/23/07, MrSinatra <
MrSinatra.2mh68b1172262901 (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
>
> i just want to be clear on this...
>
> are you saying no one at SD knows C? how about logitech?
>
> and stop pushing the "you go code it angle." i'm not a slim employee,
> don't ever plan to be, and its an old refrain from you guys that
> jeopardizes the intent of the thread.


If it's not obvious to you by now, nobody in the forums really cares about
SlimTray. If you've got something to say to slim, go ahead and tell them.
This is a community forum, not a direct line to slim.

Ben

mherger
2007-02-23, 13:45
> i'm not a slim employee,
> don't ever plan to be, and its an old refrain from you guys that
> jeopardizes the intent of the thread.

You don't know coding. Stop telling programmers what's easy, what's not.
Yes, this really is an old refrain. I'm stopping here. Have a nice weekend.

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

MrSinatra
2007-02-23, 13:55
come on kdf et al, i'm not dictating anything, i'm just ASKING why, given these issues and given the windows only usefulness of slimtray, and given that even when it works its a bloated 13meg plus systray icon, does SD stick with perl?

its not an attack, a dictation, or anything of the sort, its a fair question given the facts.

ben, your graciousness is legend. and ur dead wrong btw.

and btw, i have filed a bug for it.

bpa, you are absolutely on the right track. regardless of what language is used btw, all coders have my respect. i do some webstuff and its enough for me to know not only my own limitations, but appreciate what is done.

Robin Bowes
2007-02-23, 14:05
MrSinatra wrote:
> and several of you regulars on here always say that. not my job, and i
> don't code. SD makes and markets the product, the responsibility is
> theirs, and no i don't want this thread hijacked into another useless
> debate over the obviousness of what i'm saying.

No, you don't like people disagreeing with your opinion, do you? You
often assume that your view is the only correct way to see things. This
is demonstrated by comments like: "...useless debate over the
obviousness of what I'm saying."

Must be nice. always being right.

R.

Robin Bowes
2007-02-23, 14:07
MrSinatra wrote:
>
> and btw, i have filed a bug for it.
>

Good. Let's leave it at that then, shall we?

R.

kdf
2007-02-23, 14:09
Quoting MrSinatra <MrSinatra.2mh7dz1172264401 (AT) no-mx (DOT) forums.slimdevices.com>:

>
> come on kdf et al,

sorry. you lost me now.

MrSinatra
2007-02-23, 14:17
MrSinatra wrote:
> and several of you regulars on here always say that. not my job, and i
> don't code. SD makes and markets the product, the responsibility is
> theirs, and no i don't want this thread hijacked into another useless
> debate over the obviousness of what i'm saying.

No, you don't like people disagreeing with your opinion, do you? You
often assume that your view is the only correct way to see things. This
is demonstrated by comments like: "...useless debate over the
obviousness of what I'm saying."

Must be nice. always being right.

R.

is it not obvious that the responsibility for the code is SD's, not mine as a user?

or do you disagree? how about staying on topic rather than attacking me? can u guys handle that?

Secret Squirrel
2007-02-23, 14:21
come on kdf et al, i'm not dictating anything, i'm just ASKING why, given these issues and given the windows only usefulness of slimtray, and given that even when it works its a bloated 13meg plus systray icon, does SD stick with perl?

its not an attack, a dictation, or anything of the sort, its a fair question given the facts.

ben, your graciousness is legend. and ur dead wrong btw.

and btw, i have filed a bug for it.

bpa, you are absolutely on the right track. regardless of what language is used btw, all coders have my respect. i do some webstuff and its enough for me to know not only my own limitations, but appreciate what is done.

Just to throw a sour note in your "song"...I run SlimServer Version: 6.5.1 - 11206 - Windows XP - EN - cp1252. Slimtray is now running just under 9meg with 8 handles for about three days but no avast...Me thinks your "tune" is off key.

Best of luck, but "sweet melodies" attract a bigger, more helpful audience...if you can read between the lines ;)

SS

P.S. Let the "conductor" do the arranging.

MrSinatra
2007-02-23, 14:26
hey SS, thats interesting, Avast would be the one "unique" thing to me i think... but i'm not about to uninstall it to find out.

still, good thinking.

i am using 6.5.2 though...

chances are, bpa or someone who is far smarter than i will figure it out, or it'll simply wait to be dealt with by 7.0+

but i just like to ask why... how criminal.

y360
2007-02-23, 14:41
Bug is not related to Avast - handle leakage happens on my laptop which has Symantec AV

bpa
2007-02-23, 14:46
Y360 - are you running XP or XP pro ?

Secret Squirrel
2007-02-23, 14:49
Read Chris Owens' post in another thread regarding software engineering. You might find it informative especially if you're not a software developer yourself. I am and Chris' post is a rehash of most software development environments I have worked in. To paraphrase what he says, to attempt to fix 6.5.2 you lose the work in version 7.0

I recommend reporting your issues not arguing how/or what the solution should be. Seems as though you may have alienated some of the best folks in the forum. Me, I'd love to delve into Slim but working for a living and writing code for researcher son is already more than a day's work.

Let's just leave the heavy "lifting" to our brethren in music, and not to imbue your ideals unless you can contribute to the effort involved.

Yours in music enjoyment,
SS

MrSinatra
2007-02-23, 14:50
also y360, what SlimServer ver?

and it is possible its a shared issue, meaning something avast and norton both do, but thx for your help!

secret: i'm just asking questions. as ur new, u should wait until u have a problem to see what reaction u get b4 recommending to me... just a thought. as for alienating, its the easiest thing to do here, i long ago popped that cherry.

y360
2007-02-23, 15:02
I have XP Pro
SlimServer Version: 6.5.2 - 11466 - Windows XP - EN - cp1252

y360
2007-02-23, 15:07
Looking with Process Explorer from sysinternals.com the leakage is of process handles
It looks like slimtray iterates over all open processes and creates a new handle for each process every few seconds - so the leakage progress will depend on the number of processes the machine is running

Secret Squirrel
2007-02-23, 15:41
also y360, what SlimServer ver?

and it is possible its a shared issue, meaning something avast and norton both do, but thx for your help!

secret: i'm just asking questions. as ur new, u should wait until u have a problem to see what reaction u get b4 recommending to me... just a thought. as for alienating, its the easiest thing to do here, i long ago popped that cherry.

It may appear as though I'm new here but that is not the case. I was one of the earliest buyers of SB2. I have been "living on the edge" with SS versions, lurking here, and asking questions as I find expertise to assist me...mostly through PMs. I have yet to "step up to the mic and sing tomes...er, tunes" as you have. (I've seen you go down in flames several times, and I don't think you understand things yet.) I hear your arguments and mostly roll my eyes or grit my teeth as appropriate. I'm just requesting, as have others, that you might attempt to understand our fellow Slim forum contributers' point of view. A lot of times your "tunes" are "covers" of older issues not worth the "air time". I hear them "playing" the patches are welcome "song" asking for your contribution or at least your indulgence as they attempt to assist you.

best of luck,
SS

MrSinatra
2007-02-23, 15:53
first of all, PM me that crap, it has nothing to do with the thread.

secondly, i don't walk on eggshells, and i don't apologize for other's delicate sensibilities. i simply asked a question, and i refuse to get beatup for it, and i don't care who that annoys. TS.

if you have anything to add to the ISSUE THE THREAD IS ABOUT, please do, otherwise stop trying to get me to conform to your notions of whats appropriate. i talk about SD, the pom pom chorus instead wants to talk about me; see the difference?

please, anyone with an axe to gring about what a jerk i am, PM IT, i will happily read it there. otherwise stop hijacking this thread. and for gods sakes no more sing a song metaphors please.

bpa
2007-02-23, 16:42
Back to the problem in hand.

One of the big changes to slimtray in 6.5 was monitoring whether slimserver was active. This could tie in with y360 observation.

Its behaviour also varies depending on how the Slimserver service is setup: Manual, Auto or on Login.

So pending testing the 6.3 version of slimtray - people who have this problem should state
1. Slimserver version
2. Version of Windows
3. How is slimserver service setup to start
4. Does slimserver use port 9000 ?

to see if there is any correlation - at the moment the sample is too small to say whether XP vs XP pro is significant.

Robin Bowes
2007-02-23, 17:19
MrSinatra wrote:
> Robin Bowes;182889 Wrote:
>> MrSinatra wrote:
>>> and several of you regulars on here always say that. not my job, and
>> i
>>> don't code. SD makes and markets the product, the responsibility is
>>> theirs, and no i don't want this thread hijacked into another
>> useless
>>> debate over the obviousness of what i'm saying.
>> No, you don't like people disagreeing with your opinion, do you? You
>> often assume that your view is the only correct way to see things.
>> This
>> is demonstrated by comments like: "...useless debate over the
>> obviousness of what I'm saying."
>>
>> Must be nice. always being right.
>>
>> R.
>
> is it not obvious that the responsibility for the code is SD's, not
> mine as a user?
>
> or do you disagree? how about staying on topic rather than attacking
> me? can u guys handle that?

Reporting problems is on topic.

Stating your opinion as to possible solutions is also on topic.

Being an arrogant wanker with no clue is off-topic.

You stick on-topic and so will we.

R.

MrSinatra
2007-02-23, 18:46
this thread was 31 posts long with np... at post 32 good ole boy marc sherman started it:

http://forums.slimdevices.com/showpost.php?p=182841&postcount=32

don't blame me for the little cabal of you guys who can't handle A QUESTION which in your twisted perspectives somehow besmirches your beloved SS, which is all i'm guilty of.

PLEASE PM me your lil complaints from now on, stop screwing the thread.

bpa:

perhaps u wouldn't mind starting another thread free of this silly bile to try to troubleshoot this, (even though some claim no one cares about it).

for now, i am experimenting with the slim sql service in startup. it def happens when i had it on, (i didn't even know it was in there) i'll let you know what happens when i disable it.

i used to start the whole shebang automatically... but i stopped doing that b/c i don't want it all running as bloated as it is if i'm not using it, and it also slowed down my boot times. of course, slimtray still ran anyway, since its in startup (on the pgm menu). so the handle issue is pertinent to me, since the systray icon is how i normally start SS, and if its leaky, it may cause me problems given enough time.

thx for your efforts on it, -mdw

y360
2007-02-24, 00:00
Back to the problem in hand.

So pending testing the 6.3 version of slimtray - people who have this problem should state
1. Slimserver version
2. Version of Windows
3. How is slimserver service setup to start
4. Does slimserver use port 9000 ?


6.5.2 - 11466 - Windows XP - EN - cp1252
XP Pro
Manual start
Port 7000 (because of a conflict with Checkpoint's VPN client)

bpa
2007-02-24, 00:59
I think there is a bug in SlimTray regarding whenusing ports other than 9000 but it may be unrelated to the problem in hand.

Although Slimtray checks user prefs for the socket number - Slimtray will always try to connect to 9000 to see if Slimserver is listening. This may not have desired effect if the app on port 9000 is not Slimserver.

The code uses $rport to open the port number but if successful returns $httPort which has the value from user prefs which is not the port no. tested.



my $raddr = '127.0.0.1';
my $rport = 9000;
my $proto = (getprotobyname('tcp'))[2];
my $pname = (getprotobynumber($proto))[0];
my $sock = Symbol::gensym();
my $iaddr = inet_aton($raddr);
my $paddr = sockaddr_in($rport, $iaddr);
socket($sock, PF_INET, SOCK_STREAM, $proto);
connect($sock, $paddr);
if (defined $sock && fileno($sock)) {
close($sock);
return $httpPort;
}
return 0;

bpa
2007-02-24, 05:41
More details on the nature of the "problem".

The issue of slimtray not releasing handles occurs in the versions of slimtray in 6.5.1 and latest nightly 6.5.2. It does not happen in 6.3.

The problem happens on a clean system (i.e. only 3rd party s/w running was Acronis backup scheduler - no AV or other s/w) with a clean install of slimserver with no library and slimserver not running.

As y360 noted - every 10 secs slimtray gets a handle for each process running on the PC but doesn't release them. Using the sysinternals "handle" tool - all the unreleased handles can be detailed and they are handles to processes.

Edit:
This routine in slimtray.pl is run every 10 secs - it lists all processes then looks for slim.exe.
It looks like Win32::Process::List which is a CPAN module may be at fault - it has been rewritten
recently. A separate test will be able to confirm if this the soruce of the leak.


sub processID {
my $p = Win32::Process::List->new;
my $pid = ($p->GetProcessPid(qr/^slim\.exe$/))[0];

return $pid;
}

Robin Bowes
2007-02-24, 07:51
MrSinatra wrote:
> this thread was 31 posts long with np... at post 32 good ole boy marc
> sherman started it:
>
> http://forums.slimdevices.com/showpost.php?p=182841&postcount=32

No, you started it with the post to which Marc responded.

> don't blame me for the little cabal of you guys who can't handle A
> QUESTION which in your twisted perspectives somehow besmirches your
> beloved SS, which is all i'm guilty of.

Questions are fine. Suggestions are fine. You've already raised the bug
reports. Why not leave it at that?

SS isn't perfect - I'm not some sort of fanatical fanboy.

You just react to anyone disagreeing with your single-minded perspective
by accusing them of attacking you.

These are my last words on this subject - you're not worth it.

R.

stinkingpig
2007-02-24, 10:42
This would be a more efficient way to get the desired outcome:


if (Win32::Service::GetStatus( '',$key, \%status)) {
print "$key is present\n";
} else {
print "$key is not present\n";
}


$key needs to be the shortname of the service, not the slim.exe name.

ftlight
2007-02-24, 14:24
bpa wrote:

> So pending testing the 6.3 version of slimtray - people who have this
> problem should state
> 1. Slimserver version
> 2. Version of Windows
> 3. How is slimserver service setup to start

6.5.2 - 11332 - Windows XP - EN - cp1252
XP Home SP2
Automatic start
Port 9000
Slimtray: Mem Usage 8,840K, 1,749,645 handles

--
Bill Burns
Long Island NY USA
http://ftldesign.com

bpa
2007-02-25, 02:30
I think there is a problem is in SlimTray code in the routine ProcessID. It uses a routine called GetProcessPid in Win32::Process::List.

Changes were made to the Win32::Process::List in June 06 and GetProcessPid no longer returns -1 if the process is not running. These changes to the return behavior are not documented anywhere and even the online CPAN documentation hasn't changed and is inaccurate.

I'll do a more complete check of SlimTray before posting to bugzilla.

The code in SlimTray.pl should be changed to the following:


# Was below
# my $pid = ($p->GetProcessPid(qr/^slim\.exe$/))[0];
# return $pid ;

# Should be
my $pid = ($p->GetProcessPid(qr/^slim\.exe$/))[1];
return $pid if ( defined ($pid) ) ;
return -1;


Edit:
This may not be the cause of thr handles leak problem if Slimdevices still use verion 0.1 of Win32::Process::List.

Marc Sherman
2007-02-25, 05:02
bpa wrote:
> The problem is in SlimTray code - the routine ProcessID. It uses a
> routine called GetProcessPid in Win32::Process::List.

Yup, better rewrite it in C... :)

- Marc

bpa
2007-02-25, 05:17
Using the latest ActiveState tools, I've tried to rebuild SlimTray.exe exactly as 6.5.1 - however the resulting version didn't work because of the changes to libraries also latest ActiveState is build 820 and I think 6.5.1 was built using 819.

So I've patched SlimTray.pl as per my previous posts for GetProcessPid and the port 9000 bug. I rebuilt SlimTray - it works and doesn't leak handles on my system.

If you want to try my patched version you can find it here.

http://homepage.eircom.net/~altondsl/slim/SlimTrayexe.ZIP
1. Stop slimserver and slimtray
2. Backup your existing SlimTray.exe in case you want to revert.
3. Download and unzip my patched version into temporary area
4. Replace current SlimTray.exe in the server directory.
5. Run SlimTray from server directory or restart Windows.

Usual caveats apply and to be on the safe side run virus checker etc.

If there are no problems I'll post the patches to Developers.

bpa
2007-02-25, 05:20
bpa wrote:
> The problem is in SlimTray code - the routine ProcessID. It uses a
> routine called GetProcessPid in Win32::Process::List.

Yup, better rewrite it in C... :)

- Marc


For ulitmate irony, I was hoping the bug was in the C code that supports this Perl module - turns out the bug is in the Documentation !

Graham
2007-02-25, 08:12
Thanks bpa -- that works great for me. A steady 56 handles. You're a hero!

MrSinatra
2007-02-25, 10:35
bpa, you're a genius...

one caveat, my slimtray.exe was in the slimserver root, not the server dir, but i assume thats what you meant.

also, i had already filed a bug report for this, so i don't know if you want to post this there or what, but regardless, fantastic job. mine seems to peak at 102 handles and is now at 93.

one question, what documentation exactly are you referring to above?

also, the mysql process still doesn't stop when i use slimtray to stop SS, as the developers say it should. but i need to reboot and try some things out to see if it won't under differing various circumstances. unrelated to your great work here, just mentioning it as another ST type issue, (although its certainly possible ST isn't the 'underlying' cause)


Thanks bpa -- that works great for me. A steady 56 handles. You're a hero!

strange you feel that way graham, according to ben sandee, no one cares about this but me.


bpa wrote:
> The problem is in SlimTray code - the routine ProcessID. It uses a
> routine called GetProcessPid in Win32::Process::List.

Yup, better rewrite it in C... :)

- Marc

so clever! ha ha ha... nevermind that it uses 13megs to run, totally unnecessarily as jim pointed out.

in fact, the whole SS system, with all its various processes uses well over 100megs! (on my system anyway)

since slimtray is WINDOWS ONLY and EXTREMELY BLOATED mem usage wise considering its very limited functionality, i still believe it to be a fair and worthwhile question to ask why not C? and it is just a question. the fact that question bothers some of you so much is baffling and perplexing to me, i really wonder whats wrong with you?


MrSinatra wrote:
> this thread was 31 posts long with np... at post 32 good ole boy marc
> sherman started it:
>
> http://forums.slimdevices.com/showpost.php?p=182841&postcount=32

No, you started it with the post to which Marc responded.

i've reread the whole thread, including that post, #31. to say i started something is delusional.

please SHOW ME how i started something. you can't.



> don't blame me for the little cabal of you guys who can't handle A
> QUESTION which in your twisted perspectives somehow besmirches your
> beloved SS, which is all i'm guilty of.

Questions are fine. Suggestions are fine. You've already raised the bug
reports. Why not leave it at that?

as opposed to what? what else did i do? and who made you the arbitor of what is right and wrong anyway?


SS isn't perfect - I'm not some sort of fanatical fanboy.

oh contraire mon fraire.


You just react to anyone disagreeing with your single-minded perspective
by accusing them of attacking you.

These are my last words on this subject - you're not worth it.

R.

i was attacked, its right in the thread. like i said, i talked about SS, you and others talked about me.

big difference.

look at what you just wrote, "you're not worth it." and you're not a fanatic?

if you can't see that, thats your problem, not mine. in the future, any of you in this lil fanboy cabal can feel free to vent at me personally via a PM, i'll be more than happy to see it there. but stop ruining threads with your crap that has nothing to do with anything, and certainly not the subject of the thread.

Victor
2007-02-25, 11:03
bpa, you're a genius...
since slimtray is WINDOWS ONLY and EXTREMELY BLOATED mem usage wise considering its very limited functionality, i still believe it to be a fair and worthwhile question to ask why not C? and it is just a question. the fact that question bothers some of you so much is baffling and perplexing to me, i really wonder whats wrong with you?


The question itself doesn't bother me, nor anyone else that I can see. What bothers people is the tone in which you present your views. But I'll leave that alone, as enough people have commented on your rudeness.

But since you clearly seem to feel that you're smarter than anyone else in the room, please enlighten us with a few things:
1) What effort is involved in rewriting the code in C? Specifically enumerate the difficulties involved in doing so. If you can't, then you're not qualified to say "rewrite this in $MAGIC_LANGUAGE".

2) List specifically what technical issues would be addressed in rewriting the application in another language and what new technical issues would be introduced. And btw, "Reducing memory usage" is not a technical issue - it's a symptom. Again, if you're not qualified to discuss solutions in details, please don't be offended when people think your solutions are useless.

Your diagnosis of the problem ("Process takes up too much memory") is valid and is a good thing to bring up. But suggesting technical solutions, when you don't understand the implications of them is at best useless and at worst arrogant and rude to the developers of the software.

bpa
2007-02-25, 11:05
bpa, you're a genius...

Nope , but from years of experience I found that bugs get solved by applying effort to the problem and not by exchanging remarks. Users always get worked up about "their" problem - so I always used to let them blow off steam and tackle the problem not the person.



one caveat, my slimtray.exe was in the slimserver root, not the server dir, but i assume thats what you meant.

Correct - I wrote that from memory



also, i had already filed a bug report for this, so i don't know if you want to post this there or what, but regardless, fantastic job. mine seems to peak at 102 handles and is now at 93.

one question, what documentation exactly are you referring to above?

I'll add a comment to the bug report. The CPAN ( http://search.cpan.org/~rpagitsch/Win32-Process-List-0.06/List.pm ) synopsis is in error but I feel the bug might be a memory leak elsewhere but cured in release 820 of ActiveState tools. Since I coulnd'rt rebuilt the current SlimTray as I can't definitively what is the bug.


also, the mysql process still doesn't stop when i use slimtray to stop SS, as the developers say it should. but i need to reboot and try some things out to see if it won't under differing various circumstances. unrelated to your great work here, just mentioning it as another ST type issue, (although its certainly possible ST isn't the 'underlying' cause)

I was thinking of adding an option to ST to allow users to kill MySqld as well as Slimserver. I think the "problem" is Windows - I think it may not follow process ownership like Linux. In Linux killing Slimserver - kills mysqld - it doesn't look like that in Windows. First I'd need to look at the Slimserver code to see if explicitly tries to kill MySqld on shutdown.

kdf
2007-02-25, 11:17
On 25-Feb-07, at 10:05 AM, bpa wrote:
>>
> I was thinking of adding an option to ST to allow users to kill MySqld
> as well as Slimserver.

cool. There is bug4706 filed to cover this.

>
> I'd need to look at the Slimserver code to see if explicitly tries to
> kill MySqld on shutdown.
>
See svn change 10795, which is flagged as the confirmed fix for bug
4506.

-kdf

MrSinatra
2007-02-25, 11:55
bpa,

thx again. i should mention though that it wasn't the handles that got me 'worked up,' but rather the times i'd come back to my computer to find slimtray at 68megs and unresponsive. i didn't even know about the handles issue till after that.

thx for not tackling me, and tackling the problem. i do appreciate it.


The question itself doesn't bother me, nor anyone else that I can see. What bothers people is the tone in which you present your views. But I'll leave that alone, as enough people have commented on your rudeness.

without cause. tone is a very subjective standard, especially on a msg board, and imo, i don't see anything to object to in my "tone." certainly nothing personal, and nothing directed at any individual, (at least not at first, until someone attacked me).

sounds to me like now you're just grasping at straws, since there is no there, there. instead, we'll just attack you not on what you said, but on our subjective impressions of our feelings about what you said. lame.


But since you clearly seem to feel that you're smarter than anyone else in the room, please enlighten us with a few things:
1) What effort is involved in rewriting the code in C? Specifically enumerate the difficulties involved in doing so. If you can't, then you're not qualified to say "rewrite this in $MAGIC_LANGUAGE".

straw man. i asked why isn't it done in C? i didn't say do it in C. u apparently can't tell the difference. read the whole thread, see the evolution of the convo.

and whats really funny about this whole thing, is i didn't even bring up C first! jjzolx did. be sure you have enough wood to burn him at the stake too, (damn heretics)


2) List specifically what technical issues would be addressed in rewriting the application in another language and what new technical issues would be introduced. And btw, "Reducing memory usage" is not a technical issue - it's a symptom. Again, if you're not qualified to discuss solutions in details, please don't be offended when people think your solutions are useless.

i didn't offer a solution, i asked a question.

and i still don't have an answer to it. why is the current way of doing slimtray, better than doing it in C, IF jjzolx is correct about what he says in #5, and i have no reason to doubt him?

is the question itself impermissible? how liberal [small l] an attitude.


Your diagnosis of the problem ("Process takes up too much memory") is valid and is a good thing to bring up. But suggesting technical solutions, when you don't understand the implications of them is at best useless and at worst arrogant and rude to the developers of the software.

wow.

thats nonsense, pure and simple.

first off, i asked a question, but even if i had suggested a solution, its not what you claim it is, ie. 'rude and arrogant.'

do you people who feel this way ever leave your house?

i really don't care what those of you who have a problem with me think. i just wish you'd PM it. how is what you're doing benefitting anyone?

and the question still remains, why is the current solution for slimtray, a by definition windows only app, the best one, given the problems with it, whatever they may be?

its just a question.

vdorta
2007-02-25, 12:34
If you want to try my patched version you can find it here.

http://homepage.eircom.net/~altondsl/slim/SlimTrayexe.ZIP
I replaced SlimTray.exe with the patched version and tried both starting it and restarting Windows but it doesn't work (icon continuously on-off, when I right-click the options are greyed out). By the way, I use 6.5.1 and "Automatically run at login".

Edit: for some reason, the services reverted to Manual. in Automatic, I get an error:

"Could not start the SlimServer service. Error 2: The system cannot find the file specified."

SlimTray.exe still tries to start; I get a blank page, of course.

MrSinatra
2007-02-25, 12:55
fyi:

i set both 'slim services' in XP to manual, they don't start automatically.

slimtray does, its in the startup of my pgm menu.

my config uses localhost port 9000 btw.

its now at 62 handles (~12megs) and steady upon reboot.

when i start SS manually from ST, it starts both the slim and mysql processes, BUT the services seem to stay off. i assume thats the way its supposed to be.

the ST handles grow to about 102 and stay steady, (and ~14megs). however, as an aside, the IE window is opening to a blank page again.

in any case, ST seems ok.

i played a local file and then shutdown SS (via ST) to see if the mysql process would also shutdown, (this is what Dan says should happen in the beta forum)

mysqld.exe did NOT shutdown. slim.exe did.

so it seems some issues remain, but solid progress nonetheless.

does anyone know why someone would want those things to run as services rather than processes? is it a security/users thing?

i typically try to not use any services i don't need, and just use things as processes. so i was wondering what the reasoning was?

bpa
2007-02-25, 13:29
Vdorta,

Can you revert back to your old SlimTray and see if that still works. The error message is as a result of an extra error check I put into the processID code. I need to look up what causes it.


MrSinatra,

I'm not sure what the first bit of the post is about. Are you reporting a problem with the new SlimTray or explaining your setup to Vdorta ?

Since I now have a SlimTray development environment setup. I have a few ideas how to fix the problem opening an explorer window before Slimserver is ready - I think it has become more prevalent as it takes longer for slimserver to get ready than the expected delay in SlimTray.

I also want to set up SlimTray to modify the shortcut so that SlimTray will open the port specified in preference and not always 9000.

I also have looked at what SlimTray bugs are open including the one references by kdf and I'll see if I do something about them.

In Windows you runs processes as services so they can run when a user is not logged in - similar to Unix/Linux daemons. This was a feature lots of people requested a few years ago. You can run slim.exe as a normal user process in a dos box.

ftlight
2007-02-25, 13:49
bpa wrote:
> Using the latest ActiveState tools, I've tried to rebuild SlimTray.exe
> exactly as 6.5.1 - however the resulting version didn't work because of
> the changes to libraries also latest ActiveState is build 820 and I
> think 6.5.1 was built using 819.
>
> So I've patched SlimTray.pl as per my previous posts for GetProcessPid
> and the port 9000 bug. I rebuilt SlimTray - it works and doesn't leak
> handles on my system.

Running fine here (WinXP SP2, 6.5.2), handles steady at 57. Nice work!

--
Bill Burns
Long Island NY USA
http://ftldesign.com

MrSinatra
2007-02-25, 14:01
MrSinatra,

I'm not sure what the first bit of the post is about. Are you reporting a problem with the new SlimTray or explaining your setup to Vdorta ?

sorry, i was unclear...

the entire post above describes how things are now using your slimtray.exe

i am pretty sure it would also accurately describe the way the old one acted, except for the handles issue (obviously).

i am uncertain as to the IE issue, if the old one did that or not, or if ST is even a part of that issue. i had thought this was solved in a recent beta, as per another thread seen here:

http://forums.slimdevices.com/showthread.php?t=32843

but then i noticed some things might be off with it since that thread... basically, i didn't feel i had enough info to post about it yet.

but what is certain, is that for some reason, as per the environment i describe above and using your new ST, it isn't working now. i don't mean to suggest in any way however, that its your ST at fault, just that that is the current situation on my system.


Since I now have a SlimTray development environment setup. I have a few ideas how to fix the problem opening an explorer window before Slimserver is ready - I think it has become more prevalent as it takes longer for slimserver to get ready than the expected delay in SlimTray.

I also want to set up SlimTray to modify the shortcut so that SlimTray will open the port specified in preference and not always 9000.

great ideas. :)


I also have looked at what SlimTray bugs are open including the one references by kdf and I'll see if I do something about them.

In Windows you runs processes as services so they can run when a user is not logged in - similar to Unix/Linux daemons. This was a feature lots of people requested a few years ago. You can run slim.exe as a normal user process in a dos box.

ah, i see... so its useful for when the computer is turned on, but not logged in. very nice.

here is a link to the other thread about mysqld not shutting down:

http://forums.slimdevices.com/showthread.php?t=26650

imo the mysqld should, as dan says, shutdown with slim if slim starts it. i would rather it worked that way, then having to shutdown mysqld separately via ST or task manager.

thx again, -mdw

bpa
2007-02-25, 14:33
Maybe I'm a bit thick tonight but can you confirm that aside from not leaking handles, on your system you see NO change in behaviour of SlimTray between my version and the official version.

With regard to mysqld - by design in SS6.5.1 in Windows mySQLD is not shut down - it possible that decision was made because you can't tell if MySQLD it belongs to slimserver or not. In SS7.0 there is now code to shut mysqld down in response to a bug report. It's possible Dan was mixed up about which version was being discussed Unix or Windows 6.5.x or 7.0 behaviour.

The comment in the file MySQLHelp.pm in SS 6.5.1


=head2 stopServer()

Bring down our private copy of MySQL server.

This is a no-op if you are using a pre-configured copy of MySQL.

Or are running MySQL as a Windows service.

=cut

MrSinatra
2007-02-25, 14:44
Maybe I'm a bit thick tonight but can you confirm that aside from not leaking handles, on your system you see NO change in behaviour of SlimTray between my version and the official version.

well, the thing is i can't say for certain. i was playing around with the services and options and so on haphazardly... i'd hate to give you bad info.

what i am sure of, is how [your] ST acts now given the environment i described above.

i really can't say if that all was also true or pertaining to the old ST.

i still have a copy of the old ST, would you like me to try it?

and if so, besides the IE window, what do you want me to look for?

i would prefer to leave the slimrelated services set to manual, unless you specify different.


With regard to mysqld - by design in SS6.5.1 in Windows mySQLD is not shut down - it possible that decision was made because you can't tell if MySQLD it belongs to slimserver or not. In SS7.0 there is now code to shut mysqld down in response to a bug report. It's possible Dan was mixed up about which version was being discussed Unix or Windows 6.5.x or 7.0 behaviour.

The comment in the file MySQLHelp.pm in SS 6.5.1


=head2 stopServer()

Bring down our private copy of MySQL server.

This is a no-op if you are using a pre-configured copy of MySQL.

Or are running MySQL as a Windows service.

=cut


ok...

so basically in 7.0 ur saying SS will know, or be configurable, to have mysql shutdown with a manual shutdown of slim.exe?

if so, it might not be worth your trouble to 'fix' ST for 6.5.x, or maybe it would be easiest to just have 'shutdown mysqld' as an option separate from shutting down SS.

let me know what, if anything, u'd like me to do. -mdw

oreillymj
2007-02-25, 15:31
If you tell Slimtray to "Automatically run at log in" then the Slimserver process and associated processes are owned by the currently logged on user and can be killed much like Unix processes.

If you select "Automically run at system start" then the processes are started as a service and then they are usually owned by the local system account or unless the user specifically decides to alter the logon credentials of service. This is usualy done by owners of external or mapped drives due to a lmitiation of Windows.

You can however execute the following shell command to specifically shutdown the Slim MySQL process if started as a service and not affect any regular MySQL instances a user might have running on their box....

net stop SlimServerMySQL

bpa
2007-02-25, 15:34
Don't bother running tests - just report if my SlimTray somehow does not work in the same way it used to.

The failure to open an Slimserver IE window when slimserver starts always happens on my system with the official SlimTray and I think it is due to timing. The bug fix to which kdf referred is only relevant when port no is changed using httpport option, it won't fix this issue.

SS 7.0 is not finished so code can change but at present the Windows SS7.0 will try to stop a service called "SlimServerMySQL". I didn't look through the code to see if it configurable.

mherger
2007-02-26, 01:29
> i asked why isn't it done in C?

Because SlimServer has been developped in Perl, I guess. It's probably as
simple as that.

> does anyone know why someone would want those things to run as services
> rather than processes? is it a security/users thing?

Services are run at machine startup. You don't have to log on to run them
- just power it up and you're done. This is standard behaviour for any
server. I usually don't log on to my SlimServer (it's running headless).

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

MrSinatra
2007-02-26, 11:25
The failure to open an Slimserver IE window when slimserver starts always happens on my system with the official SlimTray and I think it is due to timing. The bug fix to which kdf referred is only relevant when port no is changed using httpport option, it won't fix this issue.

does it also happen with your ver of ST?

whats so odd, is that the newer beta kdf told me to get in the thread i quoted above did seem to fix the issue at first... but like i said, it seemed to creep back.

i wonder if ST should even call up the ie window... wouldn't the slim.exe pgm itself be the thing to trigger the window only when it was ready to do so?

btw, i have always used 9000.

i'll happily try any new versions u create, so far, this one is working totally reliably.

Simonfish
2007-02-26, 18:16
Using the latest ActiveState tools, I've tried to rebuild SlimTray.exe exactly as 6.5.1 - however the resulting version didn't work because of the changes to libraries also latest ActiveState is build 820 and I think 6.5.1 was built using 819.

So I've patched SlimTray.pl as per my previous posts for GetProcessPid and the port 9000 bug. I rebuilt SlimTray - it works and doesn't leak handles on my system.
:
:
If there are no problems I'll post the patches to Developers.

NICE work, bpa! I was about to rewrite SlimTray in C (which I may still do - 13Mb for that little thing?!!?!?) but your fix delays the need for that. Definitely a bug in the libraries too, since handles should never be leaked but still, very nice catch on your end.

- S

bpa
2007-02-26, 18:50
Don't forget if you rewrite it in C - Slimdevices may not maintain it.

AFAICT SlimTray does not take up 13Mbytes by itself. - look at the memory usage in detail.

About half of that are shared Microsoft DLLs and about 25% is the main Perl interpreter DLL which is shared with Slimserver. The remainder is SlimTray specific and is split between user data and code.

MrSinatra
2007-02-27, 12:53
I was about to rewrite SlimTray in C (which I may still do - 13Mb for that little thing?!!?!?)

wow, u have brass ones to write that after my effigy.

bpa,

i am certainly out of my depth, but would a ST app in C need all that?

seems to me i have various systray icons that do a lot more than ST does with a far smaller footprint.

again, just asking...?

oh, btw, u might want to post to that bug report, Chris was there asking about it.

Marc Sherman
2007-02-27, 13:49
MrSinatra wrote:
> Simonfish;183838 Wrote:
>> I was about to rewrite SlimTray in C (which I may still do - 13Mb for
>> that little thing?!!?!?)
>
> wow, u have brass ones to write that after my effigy.

There's a really big difference between "you should" and "I might".

- Marc

MrSinatra
2007-02-27, 16:53
MrSinatra wrote:
> Simonfish;183838 Wrote:
>> I was about to rewrite SlimTray in C (which I may still do - 13Mb for
>> that little thing?!!?!?)
>
> wow, u have brass ones to write that after my effigy.

There's a really big difference between "you should" and "I might".

- Marc

thats true, and a straw man, as i didn't say "you should" to anyone.

in the course of a long thread and running convo, i asked why not? [in reply to jjzolx saying use C] and you took it as some personal affront, which as bill o'reilly says, might just be ridiculous.

and btw, i don't HAVE to do or offer to do things myself, as a customer of SD, in order to say THEY SHOULD, if i ever want to say that. have u never said GM should offer more fuel efficient cars or something similar?

get off my back, or PM it. u don't have a leg to stand on.

bpa
2007-02-28, 16:47
I've made a few more changes to SlimTray to be tested.

1. Handles leak should still be fixed.
2. Stop MySqld.exe as well as Slim.exe when "Stop Slimserver" used.
3. "Open Slimserver" will open the port specified in prefs file and not always 9000.
4. Opening the Window in IE should be more reliable after "Start Slimserver" as with current SlimTray many times IE opens and doesn't connect to slimserver.
http://homepage.eircom.net/~altondsl/slim/SlimTray2exe.ZIP

I'll post the patch file to the bugs database to be reviewed.

With respect to size of a C version - no idea but it would probably be couple of MBytes. However personally except for the leak I wouldn't chase up as memory usage in the context of a 1Gbyte system is very small and there are plenty of other resources that will use up more memory (e.g. about 10 TTF Fonts).

MrSinatra
2007-02-28, 17:15
awesome... trying it asap!

MrSinatra
2007-02-28, 17:33
works great for me...

opens to albums in fishbone skin. (will it always do that? or can it be made to open to the last left frame you were on in fishbone?)

closes mysqld on exit. no leaky handles. i always use 9000 tho.

how long is the balloon timeout supposed to be? (i think xp does that a lot)

vast huge improvement, greatly appreciated.

bpa
2007-02-28, 17:48
opens to albums in fishbone skin. (will it always do that? or can it be made to open to the last left frame you were on in fishbone?)

I did nothing new in this area - all SlimTray does is issue the short cut in the file "SlimServer Web Interface.url" you can look at yourself or even double click it. My changes just updates that file to use right http port and not 9000. The other fix was to ensure port was ready nothing else to do with the URL.



how long is the balloon timeout supposed to be? (i think xp does that a lot)

This "sticky" effect has me puzzled as I haven't changed the code. Windows ensures the Balloons are a minimum of 10 secs and max of 30 secs. However if a Ballon is already open and another Balloon request is made then the first balloon will stay for at least 10 secs. Having Process Explorer / Task Manager open seems to have an odd effect on these Balloons.

vdorta
2007-02-28, 22:47
Great! SlimTray2.exe works well in my system.

Ramage
2007-03-01, 01:05
Great work bpa. SlimTray2 works well and those niggly problems are gone.

JJZolx
2007-03-01, 03:03
Nice work.

Want a challenge? Maybe a 'super' SlimTray. Here are some ideas:


Use an INI file for SlimTray configuration so that things like the service name aren't hardcoded into SlimTray itself. This would be transparent to most users, as you could still use hardcoded names in the absence of an INI file, or else just provide an INI containing the default names.


Permit the control of multiple instances of SlimServer. The INI file would need a service name, IP address or host name, HTTP port, and perhaps a friendly name for each server instance.


Allow the use of a non-default web browser to open the web page for the web ui. I guess you'd do this by entering the path to the browser EXE in the INI instead of opening a URL shortcut which will always use the default browser.


For convenience in restarting a SlimServer instance, add a service 'Restart' control, as in the Windows Services applet.


Best of all would be the ability to run SlimTray on a remote Windows machine to control the service(s) running on a separate Windows server. I run SlimServer on a dedicated headless Windows server, so by the time I connect to the server using Terminal Services, using SlimTray to control the server provides little convenience. What I could really use is a SlimTray running on my everyday desktop machine to stop and start the services on the server.

bpa
2007-03-01, 03:48
In Windows ini files are no longer in fashion - the registry (ugh) is the preferred MS option. Whatever mechanism is used, it would be Slimdevices who would have to support it as INI files make installation and upgrades a pain (e.g. do you have one INI file per user or one system one, what happens to INI files during upgrade) . Also INI files require user to use editors which just adds to complexity. My feeling is command line options are better.

* I think service name is hardcoded into Slimserver so this is not just a SlimTray issue.

* Current Slimserver just runs a shortcut to start IE. Give an working example of a shortcut that you can use from the desktop that does what you want. The recent change I made rewrites the shortcut using a template adding in prefs port no. where needed - allowing user supplied template should be straightforward if the your shortcut can bemade into a template.

* Don't understand what you mean by "Restart" - explain in more detail.

* remote control should be straightforward as current code uses blank for host name - realtime management of status would not be so for remote system I think a "Status" menu options would be best. Slimtray could get overloaded with functionality and confuse users especially as remote control of Windows slimservers would be a minority sport - how about a separate RemoteSlimTray which is just for controlling remote Slimservers.

One of the hardest things is to get User interface right - when the UI is elegant and intuitive, functionality is obvious. I am not good at UI - so when suggesting functionality , suggest the UI as well.

JJZolx
2007-03-01, 10:22
In Windows ini files are no longer in fashion - the registry (ugh) is the preferred MS option.

Stay out of the registry. SlimServer uses a prefs file, which is the same thing, just a different internal data format.


Whatever mechanism is used, it would be Slimdevices who would have to support it as INI files make installation and upgrades a pain (e.g. do you have one INI file per user or one system one, what happens to INI files during upgrade).

SlimServer doesn't support users, so that's not currently an issue.


Also INI files require user to use editors which just adds to complexity. My feeling is command line options are better.

Consider it a feature only for advanced users. Like I said, you could keep the current behavior via the use of the hardcoded strings within SlimTray, but look for the INI file to pick up the optional configuration. Command line options have their place, but there's no way you're going to pass a couple dozen configuration options on the command line.

It would be like the current prefs file, where some things can only be edited manually. An INI file is at least a lot more human friendly than the prefs file format. I suppose you could actually add the stuff to the SlimServer prefs file, but editing that thing requires shutting down SlimServer itself since it's constantly being written to. And it's decidedly unfriendly when it comes to editing anything but the simplest setting.


I think service name is hardcoded into Slimserver so this is not just a SlimTray issue.

But SlimTray runs completely independent of SlimServer, so if that's the case, it shouldn't have any affect on SlimTray.


Current Slimserver just runs a shortcut to start IE.

Yep. But it won't necessarily start IE. Whatever the associated application for URL file extensions is what will be launched. It'll probably be a browser, but not necessarily IE.


Give an working example of a shortcut that you can use from the desktop that does what you want. The recent change I made rewrites the shortcut using a template adding in prefs port no. where needed - allowing user supplied template should be straightforward if the your shortcut can bemade into a template.

Yep, anyone using SlimTray and SlimServer on a port other than 9000 in the past was doing exactly that - using a separate shortcut or a bookmark in a browser. If the config INI contains all the info needed to find the web server (IP address or host name and port number) then the need for a URL file is unnecessary and could give the added flexibility to run a browser of your choice.

This is a pretty trivial request. I have IE as my default browser, but find that SlimServer's web interface only works well in Firefox.


Don't understand what you mean by "Restart" - explain in more detail.

If the service is running, offer 'Restart' in the menu. Restart is just 'Stop', wait to see that the service has stopped, then 'Start'. Like I said, look at the Windows Services applet. It's just a simple convenience over manually stopping, waiting, then restarting the service. I tend to restart SlimServer a lot after updating through SVN, or to change plugins or debugging switches.


remote control should be straightforward as current code uses blank for host name - realtime management of status would not be so for remote system I think a "Status" menu options would be best.

That makes sense. The status is the least useful of all features for me. If monitoring multiple servers, then the 'green light' becomes meaningless anyway.



Slimtray could get overloaded with functionality and confuse users especially as remote control of Windows slimservers would be a minority sport - how about a separate RemoteSlimTray which is just for controlling remote Slimservers.

That would be fine, but I'm not sure it requires a separate app, so long as the interface on the default one that controls the service on the local machine looks the same with a default install.


One of the hardest things is to get User interface right - when the UI is elegant and intuitive, functionality is obvious. I am not good at UI - so when suggesting functionality , suggest the UI as well.

For Start, Stop and Restart, gray out options that don't apply, according to the running status of SlimServer. I'm not sure if SlimTray currently does this or not. If running then only Stop and Restart are possible. If not running, then only Start.

For multiple servers, use a submenu, with the friendly server names in the main menu. Select a server, then a submenu flies out and presents a link to the Web interface, plus Start, Stop, and Restart controls. For the default setup with only a single server, show no server name and present only Start, Stop, Restart in the main menu, as it is now.

Remote servers requires no addition UI changes.

Anyway, you did a fine job already. These are all just "it would be nice if" things. Like it would be nice if I could get a pony for my birthday (actually a couple strippers and a bottle of Herradura Aņejo would be prefered).

TimothyB
2007-03-02, 01:02
Thanks for building the new slimtray, bpa.

On my Win XP pro sp2 box, with 46 processes running, the stock slimtray was leaking 45 handles every ten seconds.

Is your source available? I'm thinking about taking a peek at it and maybe translating it to C++.

-- Timothy

bpa
2007-03-02, 01:17
A patch file has already been attached to the bug report. The changes are a number of small additions/aterations, no major changes. This should make them acceptable to the maintainer of SlimTray.

Before you embark on a C++ version that could replace SlimTray. Make sure that in principle Slimserver developers will accept it and maintain it - otherwise you will become the maintainer - which could be a chore with Vista.

A C++ version would have the advantage of being able to provide some functionality that JJZolx is looking for such as cascading menus which ActiveState PerlTray does not support.

ceejay
2007-03-02, 02:00
One more test data point for you:

I hadn't noticed any particular issues with slimtray but reading this thread got me interested enough to look. My handle count was approaching 1.5M. I can't now remember the memory usage but I don't think it was excessive - 12M?

SlimServer Version: 6.5.1 - 10440 - Windows XP - EN - cp1252
Win XP Pro SP2
Manual start for slimserver using Slimtray.
Port 9000

I've downloaded the patched Slimtray and it seems to be fine - handles steady at 75, nothing obviously broken. Memory usage now 6.6M.

Ceejay.

bpa
2007-03-02, 02:09
The patch file has been assigned to Dan to review but I think he is on vacation so if accepted it may be a while before any changes may appear in the nightlies.

ceejay
2007-03-02, 12:43
Further update: although the number of handles is certainly stable it does look as if there are some memory leaks here. I've left my server running for 10 hours since restarting it this morning - nothing playing, no activity anywhere, and the memory usage has gone from:

Slimserver: 76,460k to 93,208k
Slimtray: 6,672k to 7,952k

Ceejay

bpa
2007-03-02, 13:39
Curious observation. I'm trying to sort out a socketwrapper issue but I couldn't get DEBUGPIPE debug output when running 6.5.2 so I installed 6.5.0.

I now get debug output and also SlimTray doesn't leak handles
AND it is only 5.8Mbytes in size. So it looks like the memory
leak and size has also something to do with build option in 6.5.1 onwards.

Ceejay,
I've seem memory allocatyion go up when Slimserver was running and it does down when slimserver is stopped but I didn't do anuy long term test. If you want you can run Sysinternals Handles app - if handles are leaking it will tell what handles are being held by the service and identify them.

JJZolx
2007-03-02, 14:20
Curious observation. I'm trying to sort out a socketwrapper issue but I couldn't get DEBUGPIPE debug output when running 6.5.2 so I installed 6.5.0.

I now get debug output and also SlimTray doesn't leak handles
AND it is only 5.8Mbytes in size. So it looks like the memory
leak and size has also something to do with build option in 6.5.1 onwards.

There were large changes made in 6.5.1 to SlimTray. See the weirdness here:

http://bugs.slimdevices.com/show_bug.cgi?id=4318

Supposedly this was a 'blocker' to the 6.5.1 release, but it's still open and hasn't had a comment in more than a month. The impression I get from reading that bug report is that the changes are still pretty much in the experimental stage.

vdorta
2007-03-11, 13:54
Has anyone used SlimTray2.exe on Vista?

bpa
2007-03-11, 16:15
I used build 820 of the ActiveState PerlTray tool which is used to build SlimTray. According to ActiveState website from build 819 their tools have been tested on Vista.

However SlimTray uses one Perl module which does not come from ActiveState and this module makes some Win32 API calls. I think it should work with Vista but if problems arise, it should be examined.

vdorta
2007-03-11, 16:25
bpa, I will test the SlimTray2.exe later today and report back.

vdorta
2007-03-12, 08:11
I am happy to report that SlimTray2.exe works just as well in Vista.

vdorta
2007-03-13, 09:14
Hmm, I now get an error: "Can't open to write to C:\Program Files\SlimServer\SlimServer Web Interface: Permission denied", but SlimServer still opens normally.

bpa
2007-03-13, 09:55
One of the changes I made to SlimTray was to make it write the "Slimserver Web Interface" shortcut file using the port number given in preferences. With old SlimTray if a user started Slimserver on a port other then 9000 SlimTray would open up the browserwindsow on localhost:9000 and nothing would happen.

For some reason it looks like SlimTray is not allowed to write this file - some protection.

vdorta
2007-03-13, 10:23
I forgot to say that SlimTray2.exe stops SS right away when required, however, the icon stays illuminated; with the original SlimTray.exe I have to click twice for SS to stop, but if I remember well the icon turns off.