我想知道Java进程在特定时间使用的总堆大小是多少,我必须使用jmap.
输出jmap -heap <pid>
给我这样的东西:
Attaching to process ID 2899, please wait... Debugger attached successfully. Server compiler detected. JVM version is 14.2-b01 using thread-local object allocation. Parallel GC with 2 thread(s) Heap Configuration: MinHeapFreeRatio = 40 MaxHeapFreeRatio = 70 MaxHeapSize = 1258291200 (1200.0MB) NewSize = 1048576 (1.0MB) MaxNewSize = 4294901760 (4095.9375MB) OldSize = 4194304 (4.0MB) NewRatio = 8 SurvivorRatio = 8 PermSize = 16777216 (16.0MB) MaxPermSize = 67108864 (64.0MB) Heap Usage: PS Young Generation Eden Space: capacity = 119013376 …
我正在尝试在React Native中构建一个注释部分,但我无法正确处理文本溢出和省略号.
理想情况下,当用户名足够长时,应该对其进行修剪,并将动作名称一直推到右边,直到达到时间戳,如下所示:
我得到的最接近的是使用此代码:
const styles = StyleSheet.create({
commentRow: {
padding: 10
},
commentTopRow: {
flexDirection: 'row',
alignItems: 'center'
},
commentTitle: {
flex: 1
},
author: {
fontWeight: '500'
},
commentBody: {
paddingTop: 5,
paddingBottom: 5
}
});
<View style={styles.commentRow}>
<View style={styles.commentTopRow}>
<Text style={styles.commentTitle} numberOfLines={1}>
<Text style={styles.author}>User Name</Text>
<Text style={styles.action}> commented</Text>
</Text>
<Text style={styles.timestamp}>8h</Text>
</View>
<Text style={styles.commentBody}>comment body</Text>
</View>
Run Code Online (Sandbox Code Playgroud)
产生以下结果:
任何有助于确定将处理这两种情况的独特结构和样式集的帮助将非常感激.
谢谢!