diff --git a/src/libs/zbxsysinfo/solaris/memory.c b/src/libs/zbxsysinfo/solaris/memory.c
index e9ce429..4c0b8bf 100644
--- a/src/libs/zbxsysinfo/solaris/memory.c
+++ b/src/libs/zbxsysinfo/solaris/memory.c
@@ -153,19 +153,35 @@ out:
 static int	VM_MEMORY_USED(AGENT_RESULT *result)
 {
 	int		ret;
-	zbx_uint64_t	freemem;
+	zbx_uint64_t	freemem, pagesize;
 	char		*error = NULL;
 
 	zabbix_log(LOG_LEVEL_DEBUG, "In %s (with HAVE_VMINFO_T_UPDATES)", __func__);
 
-	if (SUCCEED == zbx_kstat_get_freemem(&freemem, &error))
+	if (SUCCEED == zbx_kstat_get_freemem(&freemem, &pagesize, &error))
 	{
-		long	res_SC_PHYS_PAGES, res_SC_PAGESIZE;
+		long		res_SC_PHYS_PAGES;
+		zbx_uint64_t	total;
 
 		CHECKED_SYSCONF_SYSCALL(_SC_PHYS_PAGES);
-		CHECKED_SYSCONF_SYSCALL(_SC_PAGESIZE);
 
-		SET_UI64_RESULT(result, res_SC_PHYS_PAGES * res_SC_PAGESIZE - freemem);
+		if (0 == (total = res_SC_PHYS_PAGES))
+		{
+			SET_MSG_RESULT(result, zbx_strdup(NULL, "Cannot calculate usage because total is zero."));
+			ret = SYSINFO_RET_FAIL;
+			goto out;
+		}
+
+		total *= pagesize;
+
+		if (total < freemem)
+		{
+			zabbix_log(LOG_LEVEL_WARNING, "%s() total < freemem, where total:" ZBX_FS_UI64 " freemem:"
+				ZBX_FS_UI64 " pagesize:" ZBX_FS_UI64 " delta:" ZBX_FS_I64, __func__, total, freemem,
+				pagesize, total - freemem);
+		}
+		else
+			SET_UI64_RESULT(result, total - freemem);
 	}
 	else if (NULL != error)
 	{
@@ -186,7 +202,7 @@ out:
 static int	VM_MEMORY_PUSED(AGENT_RESULT *result)
 {
 	int		ret;
-	zbx_uint64_t	freemem, total;
+	zbx_uint64_t	freemem, total, pagesize;
 	char		*error = NULL;
 	long		res_SC_PHYS_PAGES;
 
@@ -201,14 +217,18 @@ static int	VM_MEMORY_PUSED(AGENT_RESULT *result)
 		goto out;
 	}
 
-	if (SUCCEED == zbx_kstat_get_freemem(&freemem, &error))
+	if (SUCCEED == zbx_kstat_get_freemem(&freemem, &pagesize, &error))
 	{
-		long	res_SC_PAGESIZE;
-
-		CHECKED_SYSCONF_SYSCALL(_SC_PAGESIZE);
-
-		total *= res_SC_PAGESIZE;
-		SET_DBL_RESULT(result, (total - freemem) / (double)total * 100);
+		total *= pagesize;
+
+		if (total < freemem)
+		{
+			zabbix_log(LOG_LEVEL_WARNING, "%s() total < freemem, where total:" ZBX_FS_UI64 " freemem:"
+				ZBX_FS_UI64 " pagesize:" ZBX_FS_UI64 " delta:" ZBX_FS_I64, __func__, total, freemem,
+				pagesize, total - freemem);
+		}
+		else
+			SET_DBL_RESULT(result, (total - freemem) / (double)total * 100);
 	}
 	else if (NULL != error)
 	{
@@ -234,7 +254,7 @@ static int	VM_MEMORY_AVAILABLE(AGENT_RESULT *result)
 
 	zabbix_log(LOG_LEVEL_DEBUG, "In %s, (with HAVE_VMINFO_T_UPDATES)", __func__);
 
-	if (SUCCEED == zbx_kstat_get_freemem(&freemem, &error))
+	if (SUCCEED == zbx_kstat_get_freemem(&freemem, NULL, &error))
 	{
 		SET_UI64_RESULT(result, freemem);
 	}
@@ -257,7 +277,7 @@ out:
 static int	VM_MEMORY_PAVAILABLE(AGENT_RESULT *result)
 {
 	int		ret;
-	zbx_uint64_t	total, freemem;
+	zbx_uint64_t	total, freemem, pagesize;
 	char		*error = NULL;
 	long		res_SC_PHYS_PAGES;
 
@@ -272,13 +292,9 @@ static int	VM_MEMORY_PAVAILABLE(AGENT_RESULT *result)
 		goto out;
 	}
 
-	if (SUCCEED == zbx_kstat_get_freemem(&freemem, &error))
+	if (SUCCEED == zbx_kstat_get_freemem(&freemem, &pagesize, &error))
 	{
-		long	res_SC_PAGESIZE;
-
-		CHECKED_SYSCONF_SYSCALL(_SC_PAGESIZE);
-
-		total *= res_SC_PAGESIZE;
+		total *= pagesize;
 		SET_DBL_RESULT(result, freemem / (double)total * 100);
 	}
 	else if (NULL != error)
diff --git a/src/libs/zbxsysinfo/solaris/proc.c b/src/libs/zbxsysinfo/solaris/proc.c
index 73a931b..bda66b5 100644
--- a/src/libs/zbxsysinfo/solaris/proc.c
+++ b/src/libs/zbxsysinfo/solaris/proc.c
@@ -332,12 +332,12 @@ static int	proc_match_user(const zbx_sysinfo_proc_t *proc, const struct passwd *
  * Purpose: checks if the process command line matches filter                 *
  *                                                                            *
  ******************************************************************************/
-static int	proc_match_cmdline(const zbx_sysinfo_proc_t *proc, const zbx_regexp_t *cmdline)
+static int	proc_match_cmdline(const zbx_sysinfo_proc_t *proc, const zbx_regexp_t *cmdline_rxp)
 {
-	if (NULL == cmdline)
+	if (NULL == cmdline_rxp)
 		return SUCCEED;
 
-	if (NULL != proc->cmdline && 0 == zbx_regexp_match_precompiled(proc->cmdline, cmdline))
+	if (NULL != proc->cmdline && 0 == zbx_regexp_match_precompiled(proc->cmdline, cmdline_rxp))
 		return SUCCEED;
 
 	return FAIL;
@@ -367,7 +367,7 @@ static int	proc_match_zone(const zbx_sysinfo_proc_t *proc, zbx_uint64_t flags, z
  *                                                                            *
  ******************************************************************************/
 static int	proc_match_props(const zbx_sysinfo_proc_t *proc, const struct passwd *usrinfo, const char *procname,
-		const zbx_regexp_t *cmdline)
+		const zbx_regexp_t *cmdline_rxp)
 {
 	if (SUCCEED != proc_match_user(proc, usrinfo))
 		return FAIL;
@@ -375,7 +375,7 @@ static int	proc_match_props(const zbx_sysinfo_proc_t *proc, const struct passwd
 	if (SUCCEED != proc_match_name(proc, procname))
 		return FAIL;
 
-	if (SUCCEED != proc_match_cmdline(proc, cmdline))
+	if (SUCCEED != proc_match_cmdline(proc, cmdline_rxp))
 		return FAIL;
 
 	return SUCCEED;
@@ -903,6 +903,8 @@ void	zbx_proc_get_matching_pids(const zbx_vector_ptr_t *processes, const char *p
 #ifdef HAVE_ZONE_H
 	zoneid_t		zoneid;
 #endif
+	zbx_regexp_t		*proccomm_rxp = NULL;
+	char			*rxp_error = NULL;
 
 	zabbix_log(LOG_LEVEL_TRACE, "In %s() procname:%s username:%s cmdline:%s zone:%llu", __func__,
 			ZBX_NULL2EMPTY_STR(procname), ZBX_NULL2EMPTY_STR(username), ZBX_NULL2EMPTY_STR(cmdline),
@@ -917,6 +919,14 @@ void	zbx_proc_get_matching_pids(const zbx_vector_ptr_t *processes, const char *p
 	else
 		usrinfo = NULL;
 
+	if (NULL != cmdline && SUCCEED != zbx_regexp_compile(cmdline, &proccomm_rxp, &rxp_error))
+	{
+		zabbix_log(LOG_LEVEL_DEBUG, "%s() Invalid regular expression: %s", __func__, rxp_error);
+		zbx_free(rxp_error);
+		goto out;
+	}
+
+
 #ifdef HAVE_ZONE_H
 	zoneid = getzoneid();
 #endif
@@ -925,7 +935,7 @@ void	zbx_proc_get_matching_pids(const zbx_vector_ptr_t *processes, const char *p
 	{
 		proc = (zbx_sysinfo_proc_t *)processes->values[i];
 
-		if (SUCCEED != proc_match_props(proc, usrinfo, procname, cmdline))
+		if (SUCCEED != proc_match_props(proc, usrinfo, procname, proccomm_rxp))
 			continue;
 
 #ifdef HAVE_ZONE_H
diff --git a/src/zabbix_agent/zbxkstat.c b/src/zabbix_agent/zbxkstat.c
index 591ba2d..9edc1e4 100644
--- a/src/zabbix_agent/zbxkstat.c
+++ b/src/zabbix_agent/zbxkstat.c
@@ -196,9 +196,10 @@ out:
  *                      unchanged)                                            *
  *                                                                            *
  ******************************************************************************/
-int	zbx_kstat_get_freemem(zbx_uint64_t *value, char **error)
+int	zbx_kstat_get_freemem(zbx_uint64_t *value, zbx_uint64_t *pagesize, char **error)
 {
-	int			sysconf_pagesize, last, prev, ret = FAIL;
+	int			last, prev, ret = FAIL;
+	long			sysconf_pagesize;
 	zbx_kstat_vminfo_t	*vminfo;
 
 	zabbix_log(LOG_LEVEL_DEBUG, "In %s(): collector:%p", __func__, collector);
@@ -222,7 +223,11 @@ int	zbx_kstat_get_freemem(zbx_uint64_t *value, char **error)
 
 		*value = (vminfo[last].freemem - vminfo[prev].freemem) /
 				(vminfo[last].updates - vminfo[prev].updates) * sysconf_pagesize;
+
 		ret = SUCCEED;
+
+		if (NULL != pagesize)
+			*pagesize = sysconf_pagesize;
 	}
 	else
 		zabbix_log(LOG_LEVEL_DEBUG, "no new vminfo update is available");
diff --git a/src/zabbix_agent/zbxkstat.h b/src/zabbix_agent/zbxkstat.h
index 141ea78..f47d20e 100644
--- a/src/zabbix_agent/zbxkstat.h
+++ b/src/zabbix_agent/zbxkstat.h
@@ -41,7 +41,7 @@ zbx_kstat_t;
 int	zbx_kstat_init(zbx_kstat_t *kstat, char **error);
 void	zbx_kstat_destroy(void);
 void	zbx_kstat_collect(zbx_kstat_t *kstat);
-int	zbx_kstat_get_freemem(zbx_uint64_t *value, char **error);
+int	zbx_kstat_get_freemem(zbx_uint64_t *value, zbx_uint64_t *pagesize, char **error);
 
 #endif
 
