[adm-showard@cmhlcarchapp01 ~]$ cat mem.c #include #include #include int main() { struct rusage r_usage; void *m = malloc(4194304000L); memset(m,0,4194304000L); sleep (60); } [adm-showard@cmhlcarchapp01 ~]$ gcc -o mem mem.c [adm-showard@cmhlcarchapp01 ~]$ ./mem & [1] 25748 [adm-showard@cmhlcarchapp01 ~]$ pmap -d 25748 25748: ./mem…
Category: Operating Systems
Why can’t I truncate my active JBOSS server.log file?
If you find yourself in a position where it is 3AM and the filesystem on which your server.log file lives is full, you may issue some kind off redirect or “cat /dev/null > server.log”, or even “truncate –size=0 server.log”. After…
Getting SQL Server table size with Powershell
$conn = New-Object System.Data.SqlClient.SqlConnection $conn.ConnectionString = “Server=********\NCRWO;database=NCRWO_TransactionLog;Integrated Security=true;MultipleActiveResultSets=true” $conn.Open() $cmd = New-Object System.Data.SqlClient.SqlCommand $cmdInner = New-Object System.Data.SqlClient.SqlCommand $cmd.Connection = $conn $cmdInner.Connection = $conn $cmd.CommandText = “SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE=’BASE TABLE'” $swReader = $cmd.ExecuteReader() while ($swReader.Read()) { $cmdInner.CommandText =…
Who installed which packages when
Just a quick how-to this morning… # for id in $(yum history list all | grep showard | awk ‘{print $1}’ | head -1); do echo “****************************************************”; yum history info ${id}; done **************************************************** Loaded plugins: product-id, rhnplugin, search-disabled-repos, security, subscription-manager…
Spinlocks, does Oracle use them?
I often write simple C programs to better understand how a given enterprise software program works. Latches in the Oracle database are “in memory locks that protect critical sections of code”. Oracle kernel developers decide that a given section of…
Windows – who has a file open?
Use resmon.exe as shown below…
Adding a system call to Linux
These are *old* notes (2010 or so). I remember doing this, and it was interesting enough that I thought I should post it. It may be easier now. I experimented with the following on CentOS 5.1 running on an i686…
Impact of socket.SO_REUSEADDR
This is often used to get around an “address already in use” error. If you know the previous server program has been shutdown, you can set this socket option prior to the initial server bind, and then restart your program.…
PowerShell for *nix people
PowerShell is becoming (has become) the replacement for VBScript on Microsoft operating systems. It is a fairly robust scripting language that I think most administrators will be happy to see. If you have a supported Microsoft operating system (i.e., not…
Finding the other end of a Unix pipe
If you need to see the other end of the a pipe, you can use either a find for the inode, or lsof, also on the inode. We see our process of interest is waiting on a read call from…