Thumbnail generator heap full

(from github.com/freestyle68)
Hi,

very often, after a few thousands files, on smb shares Thumbnail Generator crashes.
It happen alway when jvm memory heap is always full (96% and above tipically) in the log below.
I receive this messages on fess-thumbnail.log:

2018-11-23 12:00:09,017 [CoreLib-TimeoutManager] INFO [SYSTEM MONITOR] {"os":{"memory":{"physical":{"free":2210758656,"total":33741037568},"swap_space":{"free":8433692672,"total":8433692672}},"cpu":{"percent":7},"load_averages":[1.16, 1.09, 0.85]},"process":{"file_descriptor":{"open":374,"max":65535},"cpu":{"percent":0,"total":89070},"virtual_memory":{"total":10572828672}},"jvm":{"memory":{"heap":{"used":480247808,"committed":1073741824,"max":1073741824,"percent":44},"non_heap":{"used":120457136,"committed":129220608}},"pools":{"mapped":{"count":0,"used":0,"capacity":0},"direct":{"count":46,"used":169889793,"capacity":169889792}},"gc":{"young":{"count":10,"time":316},"old":{"count":0,"time":0}},"threads":{"count":83,"peak":98},"classes":{"loaded":13249,"total_loaded":13249,"unloaded":0},"uptime":427921},"elasticsearch":null,"timestamp":1542996009017}

and when on

jvm":{"memory":{"heap ...

the “percent” is near 100% the Thumbnail Generator crashes after a few thumbnails.
I tried to increase -Xmx128m on fess_config.properties in jvm.thumbnail.options section but without success.
And, after changing Xmx, I get always

max":1073741824,"

on

jvm":{"memory":{"heap" ....

section.
There is a way to increase max heap on this process given that fess_config.properties has no influence?

Thank you

(from github.com/marevol)
In the future release, I fixed in #1921.
The workaround may be to set the following setting to 1 in fess_config.properties.

page.thumbnail.queue.max.fetch.size=1

(from github.com/freestyle68)
Tried the fix https://github.com/codelibs/fess/issues/1921 and also the workaround but same error when heap full:

I get the message on fess-thumbnail.log

jvm":{"memory":{"heap":{"used":258029464,"committed":259522560,"max":259522560,"percent":99}

and then

2018-12-02 14:02:28,509 [main] WARN  Failed to process a thumbnail generation.
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_191]
	at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_191]
	at org.codelibs.fess.thumbnail.ThumbnailManager.lambda$generate$8(ThumbnailManager.java:218) ~[classes/:?]

Why is not picking jvm.thumbnail.options for Xmx like instead on jvm.crawler.options as I can see below in fess-crawler.log?

2018-12-02 15:08:23,155 [CoreLib-TimeoutManager] INFO [SYSTEM MONITOR] {"os":{"memory":{"physical":{"free":110403584,"total":4254064640},"swap_space":{"free":3390492672,"total":6321303552}},"cpu":{"percent":18},"load_averages":[1.39, 1.44, 1.31]},"process":{"file_descriptor":{"open":282,"max":65535},"cpu":{"percent":0,"total":1581370},"virtual_memory":{"total":5619036160}},"jvm":{"memory":{"heap":{"used":990525064,"committed":1961218048,"max":2077753344,"percent":47},"non_heap":{"used":173738176,"committed":179621888}},"pools":{"direct":{"count":4,"used":147456,"capacity":147456},"mapped":{"count":0,"used":0,"capacity":0}},"gc":{"young":{"count":2951,"time":86719},"old":{"count":43,"time":6581}},"threads":{"count":22,"peak":24},"classes":{"loaded":13162,"total_loaded":13347,"unloaded":185},"uptime":10341605},"elasticsearch":null,"timestamp":1543759703155}

(from github.com/marevol)
Fixed. The thumbnail generator used options for suggest…

(from github.com/freestyle68)
Thank you!
Lower memory footprint in crawler and thumbnail jobs, and also thumbnail generator does not stop anymore.