DECLARE @tb1 Table( drive varchar(20), [MB 可用空间] varchar(20)) INSERT INTO @tb1 Exec master.dbo.xp_fixeddrives select drive , CAST( CAST((CAST([MB 可用空间] as decimal(9,2))/1024 ) as decimal(9,2)) as varchar)+'G' as 剩余空间 from @tb1
一个简单的类,用来监控JVM内存使用情况,剩余空间小于2M时报警. import java.lang.management.ManagementFactory; import java.lang.management.OperatingSystemMXBean; import java.lang.reflect.Method; /** * Test */ public class Test { public static void main(String[] args) throws Inter