diff --git a/include/zbxpreproc.h b/include/zbxpreproc.h
index 89be3544151..802258d07b0 100644
--- a/include/zbxpreproc.h
+++ b/include/zbxpreproc.h
@@ -107,7 +107,7 @@ void	zbx_preprocess_item_value(zbx_uint64_t itemid, zbx_uint64_t hostid, unsigne
 		unsigned char item_flags, AGENT_RESULT *result, zbx_timespec_t *ts, unsigned char state, char *error);
 void	zbx_preprocessor_flush(void);
 int	zbx_preprocessor_get_diag_stats(zbx_uint64_t *preproc_num, zbx_uint64_t *pending_num,
-		zbx_uint64_t *finished_num, zbx_uint64_t *sequences_num, char **error);
+		zbx_uint64_t *finished_num, zbx_uint64_t *sequences_num, zbx_uint64_t *history_size, char **error);
 int	zbx_preprocessor_get_top_sequences(int limit, zbx_vector_pp_sequence_stats_ptr_t *sequences, char **error);
 int	zbx_preprocessor_test(unsigned char value_type, const char *value, const zbx_timespec_t *ts,
 		unsigned char state, const zbx_vector_pp_step_ptr_t *steps, zbx_vector_pp_result_ptr_t *results,
diff --git a/include/zbxvariant.h b/include/zbxvariant.h
index 4885387176d..45b04ce363e 100644
--- a/include/zbxvariant.h
+++ b/include/zbxvariant.h
@@ -73,6 +73,7 @@ int		zbx_variant_convert(zbx_variant_t *value, int type);
 
 const char	*zbx_get_variant_type_desc(unsigned char type);
 const char	*zbx_variant_value_desc(const zbx_variant_t *value);
+uint64_t	zbx_variant_value_size(const zbx_variant_t *value);
 const char	*zbx_variant_type_desc(const zbx_variant_t *value);
 
 int		zbx_variant_compare(const zbx_variant_t *value1, const zbx_variant_t *value2);
diff --git a/src/libs/zbxpreproc/pp_diag.c b/src/libs/zbxpreproc/pp_diag.c
index bc569fb034a..665bd558240 100644
--- a/src/libs/zbxpreproc/pp_diag.c
+++ b/src/libs/zbxpreproc/pp_diag.c
@@ -73,11 +73,11 @@ int	zbx_diag_add_preproc_info(const struct zbx_json_parse *jp, struct zbx_json *
 
 		if (0 != (fields & ZBX_DIAG_PREPROC_SIMPLE))
 		{
-			zbx_uint64_t	preproc_num, pending_num, finished_num, sequences_num;
+			zbx_uint64_t	preproc_num, pending_num, finished_num, sequences_num, history_size;
 
 			time1 = zbx_time();
 			if (FAIL == (ret = zbx_preprocessor_get_diag_stats(&preproc_num, &pending_num, &finished_num,
-					&sequences_num, error)))
+					&sequences_num, &history_size, error)))
 			{
 				goto out;
 			}
@@ -91,6 +91,7 @@ int	zbx_diag_add_preproc_info(const struct zbx_json_parse *jp, struct zbx_json *
 				zbx_json_adduint64(json, "pending tasks", pending_num);
 				zbx_json_adduint64(json, "finished tasks", finished_num);
 				zbx_json_adduint64(json, "task sequences", sequences_num);
+				zbx_json_adduint64(json, "history size", history_size);
 			}
 		}
 
diff --git a/src/libs/zbxpreproc/pp_manager.c b/src/libs/zbxpreproc/pp_manager.c
index f1cee6a2fb0..5d915e67497 100644
--- a/src/libs/zbxpreproc/pp_manager.c
+++ b/src/libs/zbxpreproc/pp_manager.c
@@ -20,6 +20,7 @@
 #include "zbxpreproc.h"
 #include "zbxcommon.h"
 #include "zbxalgo.h"
+#include "zbxpreprocbase.h"
 #include "zbxtimekeeper.h"
 #include "zbxself.h"
 #include "zbxstr.h"
@@ -643,6 +644,28 @@ static void	zbx_pp_manager_dump_items(zbx_pp_manager_t *manager)
 
 }
 
+static zbx_uint64_t	zbx_pp_manager_items_preproc_history_size(zbx_pp_manager_t *manager)
+{
+	zbx_hashset_iter_t	iter;
+	zbx_pp_item_t		*item;
+	zbx_uint64_t		history_size = 0;
+
+	zbx_hashset_iter_reset(&manager->items, &iter);
+
+	while (NULL != (item = (zbx_pp_item_t *)zbx_hashset_iter_next(&iter)))
+	{
+		if (1 != item->preproc->refcount)
+			continue;
+		if (NULL == item->preproc->history)
+			continue;
+
+		for (int i = 0; i < item->preproc->history->step_history.values_num; i++)
+			history_size += zbx_variant_value_size(&item->preproc->history->step_history.values[i].value);
+	}
+
+	return history_size;
+}
+
 /******************************************************************************
  *                                                                            *
  * Purpose: get item configuration data for reading and updates               *
@@ -1026,12 +1049,14 @@ static void	preprocessor_flush_tasks(zbx_pp_manager_t *manager, zbx_vector_pp_ta
  ******************************************************************************/
 static void	preprocessor_reply_diag_info(zbx_pp_manager_t *manager, zbx_ipc_client_t *client)
 {
-	zbx_uint64_t	preproc_num, pending_num, finished_num, sequences_num;
+	zbx_uint64_t	preproc_num, pending_num, finished_num, sequences_num, history_size;
 	unsigned char	*data;
 	zbx_uint32_t	data_len;
 
 	zbx_pp_manager_get_diag_stats(manager, &preproc_num, &pending_num, &finished_num, &sequences_num);
-	data_len = zbx_preprocessor_pack_diag_stats(&data, preproc_num, pending_num, finished_num, sequences_num);
+	history_size = zbx_pp_manager_items_preproc_history_size(manager);
+	data_len = zbx_preprocessor_pack_diag_stats(&data, preproc_num, pending_num, finished_num, sequences_num,
+			history_size);
 
 	zbx_ipc_client_send(client, ZBX_IPC_PREPROCESSOR_DIAG_STATS_RESULT, data, data_len);
 
diff --git a/src/libs/zbxpreproc/pp_protocol.c b/src/libs/zbxpreproc/pp_protocol.c
index f2cbeced262..abc95a5faf9 100644
--- a/src/libs/zbxpreproc/pp_protocol.c
+++ b/src/libs/zbxpreproc/pp_protocol.c
@@ -480,7 +480,8 @@ zbx_uint32_t	zbx_preprocessor_pack_test_result(unsigned char **data, const zbx_p
  *                                                                            *
  ******************************************************************************/
 zbx_uint32_t	zbx_preprocessor_pack_diag_stats(unsigned char **data, zbx_uint64_t preproc_num,
-		zbx_uint64_t pending_num, zbx_uint64_t finished_num, zbx_uint64_t sequences_num)
+		zbx_uint64_t pending_num, zbx_uint64_t finished_num, zbx_uint64_t sequences_num,
+		zbx_uint64_t history_size)
 {
 	unsigned char	*ptr;
 	zbx_uint32_t	data_len = 0;
@@ -489,6 +490,7 @@ zbx_uint32_t	zbx_preprocessor_pack_diag_stats(unsigned char **data, zbx_uint64_t
 	zbx_serialize_prepare_value(data_len, pending_num);
 	zbx_serialize_prepare_value(data_len, finished_num);
 	zbx_serialize_prepare_value(data_len, sequences_num);
+	zbx_serialize_prepare_value(data_len, history_size);
 
 	*data = (unsigned char *)zbx_malloc(NULL, data_len);
 
@@ -496,7 +498,8 @@ zbx_uint32_t	zbx_preprocessor_pack_diag_stats(unsigned char **data, zbx_uint64_t
 	ptr += zbx_serialize_value(ptr, preproc_num);
 	ptr += zbx_serialize_value(ptr, pending_num);
 	ptr += zbx_serialize_value(ptr, finished_num);
-	(void)zbx_serialize_value(ptr, sequences_num);
+	ptr += zbx_serialize_value(ptr, sequences_num);
+	(void)zbx_serialize_value(ptr, history_size);
 
 	return data_len;
 }
@@ -703,14 +706,16 @@ void	zbx_preprocessor_unpack_test_result(zbx_vector_pp_result_ptr_t *results, zb
  *                                                                            *
  ******************************************************************************/
 void	zbx_preprocessor_unpack_diag_stats(zbx_uint64_t *preproc_num, zbx_uint64_t *pending_num,
-		zbx_uint64_t *finished_num, zbx_uint64_t *sequences_num, const unsigned char *data)
+		zbx_uint64_t *finished_num, zbx_uint64_t *sequences_num, zbx_uint64_t *history_size,
+		const unsigned char *data)
 {
 	const unsigned char	*offset = data;
 
 	offset += zbx_deserialize_value(offset, preproc_num);
 	offset += zbx_deserialize_value(offset, pending_num);
 	offset += zbx_deserialize_value(offset, finished_num);
-	(void)zbx_deserialize_value(offset, sequences_num);
+	offset += zbx_deserialize_value(offset, sequences_num);
+	(void)zbx_deserialize_value(offset, history_size);
 }
 
 /******************************************************************************
@@ -1056,7 +1061,7 @@ out:
  *                                                                            *
  ******************************************************************************/
 int	zbx_preprocessor_get_diag_stats(zbx_uint64_t *preproc_num, zbx_uint64_t *pending_num,
-		zbx_uint64_t *finished_num, zbx_uint64_t *sequences_num, char **error)
+		zbx_uint64_t *finished_num, zbx_uint64_t *sequences_num, zbx_uint64_t *history_size, char **error)
 {
 	unsigned char	*result;
 
@@ -1066,7 +1071,7 @@ int	zbx_preprocessor_get_diag_stats(zbx_uint64_t *preproc_num, zbx_uint64_t *pen
 		return FAIL;
 	}
 
-	zbx_preprocessor_unpack_diag_stats(preproc_num, pending_num, finished_num, sequences_num, result);
+	zbx_preprocessor_unpack_diag_stats(preproc_num, pending_num, finished_num, sequences_num, history_size, result);
 	zbx_free(result);
 
 	return SUCCEED;
diff --git a/src/libs/zbxpreproc/pp_protocol.h b/src/libs/zbxpreproc/pp_protocol.h
index 708d6e0c4b8..69df314b4f1 100644
--- a/src/libs/zbxpreproc/pp_protocol.h
+++ b/src/libs/zbxpreproc/pp_protocol.h
@@ -70,10 +70,12 @@ void	zbx_preprocessor_unpack_test_result(zbx_vector_pp_result_ptr_t *results, zb
 		const unsigned char *data);
 
 zbx_uint32_t	zbx_preprocessor_pack_diag_stats(unsigned char **data, zbx_uint64_t preproc_num,
-		zbx_uint64_t pending_num, zbx_uint64_t finished_num, zbx_uint64_t sequences_num);
+		zbx_uint64_t pending_num, zbx_uint64_t finished_num, zbx_uint64_t sequences_num,
+		zbx_uint64_t history_size);
 
 void	zbx_preprocessor_unpack_diag_stats(zbx_uint64_t *preproc_num, zbx_uint64_t *pending_num,
-		zbx_uint64_t *finished_num, zbx_uint64_t *sequences_num, const unsigned char *data);
+		zbx_uint64_t *finished_num, zbx_uint64_t *sequences_num, zbx_uint64_t *history_size,
+		const unsigned char *data);
 
 zbx_uint32_t	zbx_preprocessor_pack_top_sequences_request(unsigned char **data, int limit);
 
diff --git a/src/libs/zbxvariant/variant.c b/src/libs/zbxvariant/variant.c
index 18f2053569f..286fde7d37e 100644
--- a/src/libs/zbxvariant/variant.c
+++ b/src/libs/zbxvariant/variant.c
@@ -389,6 +389,33 @@ const char	*zbx_variant_value_desc(const zbx_variant_t *value)
 	}
 }
 
+uint64_t	zbx_variant_value_size(const zbx_variant_t *value)
+{
+	zbx_uint32_t			size;
+
+	switch (value->type)
+	{
+		case ZBX_VARIANT_DBL:
+			return sizeof(double);
+		case ZBX_VARIANT_UI64:
+			return sizeof(zbx_uint64_t);
+		case ZBX_VARIANT_STR:
+			return strlen(value->data.str);
+		case ZBX_VARIANT_NONE:
+			return 0;
+		case ZBX_VARIANT_BIN:
+			memcpy(&size, value->data.bin, sizeof(size));
+			return size;
+		case ZBX_VARIANT_ERR:
+			return strlen(value->data.err);
+		case ZBX_VARIANT_VECTOR:
+			return 0;
+		default:
+			THIS_SHOULD_NEVER_HAPPEN;
+			return 0;
+	}
+}
+
 const char	*zbx_get_variant_type_desc(unsigned char type)
 {
 	switch (type)
