Skip to content

Media Player loses connection to DLNA Server

I had problems connecting from my Samsung Smart TV to a freshly installed minidlna server.

The TV would start playing perfectly fine, but then randomly lose connection, and the server disappearing from the list.

After turning on logging output by editing




it turns out that the culprit was inotify getting out of watches:

 inotify.c:198: warn: WARNING: Inotify max_user_watches [8192] is low or close to the number of used watches [4] and I do not have permission to increase this limit.  Please do so manually by writing a higher value into /proc/sys/fs/inotify/max_user_watches.
Setting this to 100 000 by issuing the command

sudo su echo 100000 > /proc/sys/fs/inotify/max_user_watches

and then restarting the host, made the issue go away completely.



How to get jstack and jmap to work with Tomcat 7 installed as a service on Windows Server 2008 R2

Today I had an application server running on Tomcat 7 installed as a service, and I wanted to inspect memory and stack.

The problem is that the service, like most services, was running as ‘Local System’ and the java tools can only see processes from the same user.

The situation is further complicated thru Windows Server 2008 R2 no longer allowing any kind of interaction on part of the Local System account.

There are many pages on the internet outlining solutions, but what worked for me was this:

  1. If you’re remote desktopping, be sure to start remote desktop with the command
    mstsc /admin
  2. Install PsTools and make sure psexec is on your path
  3. Open up Task Manager, and find the PID (process id) of the tomcat (or any other java app that is running as a service)
  4. execute
    psexec -s {full path to jdk bin}jstack {PID} >> jstack.log
    psexec -s {full path to jdk bin}jjmap -dump:format=b,file=jmap.dump {PID} 
  5. Inspect jstack.log and jmap.dump