Friday, 6 May 2016

KDE Plasma 4 Memory Problems

Yesterday I wrote that after using Elementary OS Freya for quite a long time I finally decided to move back to Mint.  Now, my desktop of choice is obviously KDE.  And as I mentioned I installed KDE on top of the Mint 17.3 iso I had burned.  And all seemed to work beautifully, long enough to write my blog entry.

Later in the day though I felt the system loading up and checked resources.  This computer only has 4GB of RAM, and Mint with KDE installed was chewing up over 3.5GB!

To top that off, plasma-desktop was hogging around 900MB of that even after all open programs were closed.  A quick restart of plasma without actually logging out brought plasma's memory use back to a bit over 130MB.

Over the next few hours plasma-desktop kept creeping up and up and the system got slower and slower.  A quick restart of plasma and it all began again.

A bit of Googling showed this has been an on-going problem with plasma for years and it is still an issue with the new Plasma 5.  So I did a little thinking on it.  I had this problem in the past with Kubuntu.  And I had it previously when I installed KDE on top of Mint MATE or Cinnamon.

I tried all sorts of tweaks and settings and config file mods.  I even played with proprietary drivers and turned off all desktop effects and killed things like Docky.  Installed lighter weight browsers, because the thing that trigger the freezing was saving a web page as a PDF from any of the browsers.  But nothing worked.

Anyway, this morning I decided to download and install Mint 17.3 KDE version and try it.

The results are startling so far.  The memory leak is still there to some extent and RAM still creeps up, but over a whole day and with everything running, including two monitors with multiple desktops with separate wallpaper on every desktop on both monitors (that's 8 separate wallpapers) some of which are images, some are slideshows and one is a video wallpaper showing through an oval port hole on the secondary screen.

And as well as normal programs I had Openshot rendering a video.  Plasma-desktop RAM use got way up to 167MB for a while and is now back to 148MB.

And on the next day...
I added an Activity (that's like adding an extra computer within my computer, complete with all the virtual desktops etc). and now there are two screens with two activities, each with 4 virtual desktops per activity.  So KDE is coping nicely with 16 virtual desktops across two monitors.

plasma-desktop is averaging 150MB to 180MB of RAM use and total memory use is staying around 1.1GB to 1.6GB.

Seems that if you install a KDE desktop, you should NOT install any other desktops (Don;t install Mate, Cinnamon, XFCE ets and switch between them at login).

And if you install any GNOME based distro and add other desktops, DON'T add KDE.

You can add most, but not all, GNOME programs to KDE, but even then, if there's a KDE version of the program that will do the job, it is better to use it.
If for example you install Nautilus or NEMO in KDE, you run the risk of breaking KDE.

External Cellphone Antenna - does Inductive Coupling Work?

These days finding a mobile phone with a socket for an external antenna is not easy.  With carriers putting up more towers, even in Australia much of the country is covered by a reasonable signal, and of course, who really wants a bulky cable hanging off phones that are getting smaller and smaller.

But Australia is a big country with a tiny population and the revenues even from phone use don't allow complete coverage.  I sometimes stay in a place that only has voice signal in three spots, each comprising a few square metres, and only if you happen to have a particular type of day.  Even in those spots we have to wave the phone around until we catch a signal and even then it is only possible to send SMS.  Voice calls are impossible.  Data, if enabled, will allow use of Viber or Skype for messages, but voice simply won't work.

Having been trained as a radio tech in the defence force back in the 70's and a radio hobbyist prior to joining up as well as a CB enthusiast afterwards, I have some experience in getting signals in strange places.  I set up the radio communications for Police and SES in a rural Queensland location using only off the shelf and cobbled together equipment.  With that we conducted many successful search and rescue ops and natural disaster operations over some years, in terrain where radio communications were supposed to be impossible, until funding was made available for proper gear.  It just took a bit of 'sideways thinking' and unusual design.

So I was aware of inductive coupling, and even had an old through windscreen phone antenna lying around.  The brain started working.  The site is 34.5 kilometres in a direct line from the Telstra/Optus shared tower.  But we are on the other side of an island, behind a hill.  That makes a difference to antenna choice.  My first plan was to build either a YAGI or a Bi Quad design, but I decided to test the idea with my old car antenna first to save money.  The plan was that if there was even a tiny increase, even if I got one bar steady, it would be worth building an antenna.  The results amazed me!

The magnetic mount car antenna was for Telstra's 3G network, and being experienced in communications (albeit a long time ago) I knew that to get the signal in over about 6 metres I would need 'low loss' cable rather than the common cheap RG58U that is used for short runs on things like CB radios.

However this was an experiment, RG58U is cheap and can be found almost anywhere.  I opted for 6 metres of the cheap stuff.  It is thin, light weight, flexible and easy to work with, and the losses would not be too bad.

I planned to mount the antenna up on a pole, and a magnetic car antenna is designed to use the car's roof as a ground plane to reflect the signal to the antenna.  Having a square piece of tin on top of a pole in 30 knot winds is not going to make life easy.  A bit of sideways thought and I found an old circular wire thingy.   Not really big enough but it might work.  I tried it on the pole then once it worked I tied it to a nice solid beam.

The car windscreen antenna has a flat base that the antenna sits on stuck to the outside of the glass, then the coupling on the inside of the windscreen.  Now this coupling looks like an empty plastic box, but inside it is a little printed circuit board and the track on the board is designed to be just the right length to resonate with the cell wavelength - in this case about 850MHz.  But the distances between the bottom of the antenna and the circuit board are supposed to be pretty precise.



My problem was that I would not be using the coupling to receive the signal.  I would attach the coupling to the end of the cable and use it to send the signal to the phone.  I knew it should work, but I was not sure if it actually would.


For the first test I simply stuck velcro to the back of the phone and the front and back of the coupling.  Then I placed the coupling half way up the back of the phone and watched as the signal went from between no bars and one bar, to a couple of bars.  I got a signal strength reading of 28%.  I thought that was great, and made a test voice call.  For the first time ever I could call someone,

Then I decided to try turning the coupling 'the wrong way', just out of curiosity.  You can see the signal trace line jumping around a bit as I messed around trying to make a curved surface sit flat against the phone.  But in the next pics the signal is sitting rock solid for about 5 minutes on 46%.  And that's pretty well where it stayed.

A couple of things here.  I took pics with various cameras and there was a series taken at different spots on the island showing the zero to one bar signals.  Just before I left I went swimming, and so did the pocket camera.



The signal stayed rock solid at 46% for ages.  As the weather changed from cloudy to sunny it would drop to around 38-42%, then as the clouds returned it rose to 45/46% again and settled.  partial cloud gave the best signal, clear skies and rain reduced the signal.  but at least, for the first time in almost 12 months, there was 24 hour a day signal!



The last pics are just for comparison with  the same phone back in the city with NO external antenna.  The signal in my room and even near a window is only about 39% and fluctuating.

There are lots of Inductive Coupling cradles for connecting an antenna to a smart phone in a car.  Some are better than others, but if you know where the antenna is in your phone (these days most are at the bottom, to protect your head from radiation) you should be able to position the phone on even a cheap inductive cradle and get similar results to my system.  And it will be easier to use.

We have similar signal problems on Isla Verde, so I might be using this method again.  To make it easier there I'll test a cheap cradle from ebay when I have the chance.