You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the open source repository containerd/rust-extensions. When I use protobuf 0.28.0, the memory cost is about 900KB. But when I use protobuf 0.3.0 or 0.4.0, the momory usage is abot 1200KB.
I used the valgrind memory capture tool to collect the memory of the process, and the result is as follows:
for 0.3.0 or 0.4.0
for 0.28.0
By analyzing the results, I found that the function file_descriptor takes up about 300KB of heap memory. This function is in the end of file /src/descriptor.rs. This function was not available in version 0.28.0.
Also, I found that the Message struct in 0.28.0 became the current MessageFull struct, and when I removed the related dependencies of the messageFull struct in the containerd/rust-extensions project (which of course caused the rust-extensions project to not work properly) I noticed that the memory dropped by about 400KB.
I cannot use Message struct in 0.3.0 because of PartialEq.
The differences between 0.28.0(/src/message.rs) and 0.3.0(/src/message.rs and /src/messagedyn.rs):
0.3.0 pub trait Message: Default + Clone + Send + Sync + Sized + PartialEq + 'static { pub trait MessageDyn: Any + fmt::Debug + fmt::Display + Send + Sync + 'static {
We can see that in 0.3.0 static is used in both the Message struct and the MessageDyn struct, but not in 0.28.0
I wonder what the modification of the Message struct and the addition of file_descriptor functions are? Does it really need to be defined as static? This results in an unusually large memory overhead.
The text was updated successfully, but these errors were encountered:
I'm using the open source repository containerd/rust-extensions. When I use protobuf 0.28.0, the memory cost is about 900KB. But when I use protobuf 0.3.0 or 0.4.0, the momory usage is abot 1200KB.
I used the valgrind memory capture tool to collect the memory of the process, and the result is as follows:
By analyzing the results, I found that the function
file_descriptor
takes up about 300KB of heap memory. This function is in the end of file/src/descriptor.rs
. This function was not available in version 0.28.0.Also, I found that the
Message
struct in 0.28.0 became the currentMessageFull
struct, and when I removed the related dependencies of the messageFull struct in the containerd/rust-extensions project (which of course caused the rust-extensions project to not work properly) I noticed that the memory dropped by about 400KB.I cannot use
Message
struct in 0.3.0 because ofPartialEq
.The differences between 0.28.0(/src/message.rs) and 0.3.0(/src/message.rs and /src/messagedyn.rs):
pub trait Message: fmt::Debug + Clear + Any + Send + Sync { .....
pub trait Message: Default + Clone + Send + Sync + Sized + PartialEq + 'static {
pub trait MessageDyn: Any + fmt::Debug + fmt::Display + Send + Sync + 'static {
We can see that in 0.3.0
static
is used in both theMessage
struct and theMessageDyn
struct, but not in 0.28.0I wonder what the modification of the
Message
struct and the addition offile_descriptor
functions are? Does it really need to be defined asstatic
? This results in an unusually large memory overhead.The text was updated successfully, but these errors were encountered: