pub struct MemoryFragmentationSnapshot {
pub timestamp: DateTime<Utc>,
pub device_id: i32,
pub total_memory: usize,
pub free_memory: usize,
pub largest_free_block: Option<usize>,
pub fragmentation_ratio: Option<f64>,
pub free_block_distribution: Option<Vec<usize>>,
pub external_fragmentation: Option<f64>,
pub internal_fragmentation: Option<f64>,
}Expand description
Memory fragmentation analysis
Fields§
§timestamp: DateTime<Utc>§device_id: i32§total_memory: usizeCapacity this pool was configured with – see GpuMemoryPool’s
own doc comment for how that number is obtained (this crate has no
pure-Rust GPU memory query API).
free_memory: usizeReal remaining capacity: total_memory minus the real sum of
currently-outstanding allocations tracked via
AdvancedGpuMemoryProfiler::track_allocation /
AdvancedGpuMemoryProfiler::track_deallocation – genuine
bookkeeping from real call arguments, not fabricated.
largest_free_block: Option<usize>Size of the largest contiguous free block, when measurable. This
pool tracks only a running free-BYTE COUNT, never the placement of
individual allocations in address space, so it has no way to know
whether that free capacity is one block or many small ones –
None, never a claim that all free memory forms one contiguous
block (the previous behavior).
fragmentation_ratio: Option<f64>None for the same reason as Self::largest_free_block: real
fragmentation is a function of block placement and allocator
policy, neither of which this crate tracks or simulates.
free_block_distribution: Option<Vec<usize>>Per-block free-space sizes, when known. None – not an empty
Vec, which would misleadingly read as “zero free blocks exist”
– see Self::largest_free_block.
external_fragmentation: Option<f64>None for the same reason as Self::fragmentation_ratio.
internal_fragmentation: Option<f64>None for the same reason as Self::fragmentation_ratio.
Trait Implementations§
Source§impl Clone for MemoryFragmentationSnapshot
impl Clone for MemoryFragmentationSnapshot
Source§fn clone(&self) -> MemoryFragmentationSnapshot
fn clone(&self) -> MemoryFragmentationSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryFragmentationSnapshot
impl Debug for MemoryFragmentationSnapshot
Source§impl<'de> Deserialize<'de> for MemoryFragmentationSnapshot
impl<'de> Deserialize<'de> for MemoryFragmentationSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MemoryFragmentationSnapshot
impl RefUnwindSafe for MemoryFragmentationSnapshot
impl Send for MemoryFragmentationSnapshot
impl Sync for MemoryFragmentationSnapshot
impl Unpin for MemoryFragmentationSnapshot
impl UnsafeUnpin for MemoryFragmentationSnapshot
impl UnwindSafe for MemoryFragmentationSnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ConfigSerializable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
impl<T> ConfigSerializable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
Source§fn save_to_file(&self, path: &Path) -> Result<(), TrustformersError>
fn save_to_file(&self, path: &Path) -> Result<(), TrustformersError>
Source§fn load_from_file(path: &Path) -> Result<Self, TrustformersError>where
Self: Sized,
fn load_from_file(path: &Path) -> Result<Self, TrustformersError>where
Self: Sized,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.