In this case, you can try to set cgroup memory soft limit in Cloudera Manager Hue configuration page, but I do not believe it will help much. It is a known issue in Hue due to Python memory fragmentation. There are a few common operations in Hue that might trigger it, such as download large query result set (more than 10M) or use HDFS file browser to browse an HDFS directory with a large number of files(1000+). Ask your users to refrain from doing these operations.
If this memory problem keeps happening, you can use the script at https://github.com/cloudera/hue/blob/master/tools/ops/hue_mem_cron.sh to setup a cron job. The script monitors the Hue process memory usage and kill it if it uses too much. You need to configure Cloudera Manager to restart Hue automatically.
Of course, killing the Hue is not an ideal solution. What you can do is to setup Hue HA with a load balancer in front of multiple Hue instances to alleviate the problem. You can follow documentation https://www.cloudera.com/documentation/enterprise/latest/topics/cdh_hag_hue_config.html to set it up