psi-plus / main

Main repository with patches and required resources
https://psi-plus.com/
GNU Lesser General Public License v2.1
68 stars 20 forks source link

Significant memory usage when many hunspell dictionaries are available #695

Closed formusiclgl closed 6 years ago

formusiclgl commented 6 years ago

Hello! Psi+ v1.2.75 (2017-09-12, Psi:f78fd0ec, Psi+:43fb3ea) Win7 sp1 x64. Psi+ take 530 MB RAM, is it normal ?

Ri0n commented 6 years ago

how many contacts do you have? Do you see memory usage growing in a hour/day?

formusiclgl commented 6 years ago

4 contacts, RAM allocate may change +- 20-30 MB per day

Ri0n commented 6 years ago

I see 38M consumption with official release and 300 contacts. If you use portable build you have to manually remove everything useless from myspell/dicts otherwise all of them will be loaded taking a lot of memory.

formusiclgl commented 6 years ago

After clearing myspell/dicts consumption is ok.

tehnick commented 6 years ago

And what may I do in this case? Do you suggest to delete all languages except six chosen ones (as done in builds from KukuRuzo)? This is discrimination of other users...

BTW, Which language for spell checking is default in settings? Hunspell should not load all available languages, if only one or few languages are selected.

Ri0n commented 6 years ago

I honestly don't know. There are many ways to solve this.

What we need is the idea which will satisfy the majority. But currently installer has language selector and the problem is related to portable builds.

formusiclgl commented 6 years ago

In setting->application->language is By default. I cannot find spell checking language settings. Acceptable variant like Firefox do. Right mouse button click on input field->spell checking->choose language. At first time load only relevant by setting->application->language

Ri0n commented 6 years ago

I believe Firefox also has not trivial logic behind. For example it offers me to select Spanish while my system has no Spanish dicts. I guess it collects some stats somehow and offers relevant based on them. In Psi we can always load English (as a very popular language) and some others based on current locale and selected language for interface. But put them all in the menu like in Firefox not the good idea. There are too many languages. Nevertheless I like how it's done in Firefox.

PS I learn Spanish

formusiclgl commented 6 years ago

There are too many languages

Yes. If you installed many languages in Firefox, so there will be many languages too. So

  1. Download dictionaries in runtime + Right mouse button click on input field->spell checking->choose language (like Firefox) or
  2. Spell checking language settings with check boxes + Right mouse button click on input field->spell checking->choose language (from checked items in Spell checking language settings)
tehnick commented 6 years ago

I cannot find spell checking language settings.

Settings dialog --> Advanced --> options --> ui --> spell-check --> langs (use short language names and comma as a separator, for example "ru,en")

formusiclgl commented 6 years ago

Thank you! it's hard to find

formusiclgl commented 6 years ago

I have empty Settings dialog --> Advanced --> options --> ui --> spell-check --> langs

tehnick commented 6 years ago

I have just checked in WinXP: the amount of memory used by Psi+ does not depend on value of langs variable in settings. It looks like a bug in our usage of hunspell.

tehnick commented 6 years ago

More over, after deleting of myspell subdirectory Psi+ launches and connects to xmpp servers almost momentary. So it is definitely a bug and serious one.

tehnick commented 6 years ago

Added a simple workaround to all portable builds. See available-dicts subdirectory and ReadMe.dictionaries.txt.

formusiclgl commented 6 years ago

If you move ReadMe.dictionaries.txt to folder with psi-plus-portable.exe more then 1 people will read it :)

tehnick commented 6 years ago

@formusiclgl This is only a temporary workaround. KukuRuzo is working on real solution now.

tehnick commented 6 years ago

Fixed in b7f8ecdb8864f4a88a97c37672aecb986cbf6578