Why does a log file grow even when transaction is not commited? Below is what I did:


Created database in simple recovery mode.
Created table.
Began tran and inserted so many rows to exceed size of the log file. 
Committed the transaction.


Before step 4 I noticed that log file grew, which confused me. Why did that happen?

According to MSDN:


  For each logical write, a transaction log record is inserted in the log cache that records the modification.


And then:


  Log records are written to disk when the transactions are committed.


So how do you explain the fact that the log file is growing when the data is being inserted, even when a transaction is not committed? 

As I understand, uncommitted log records should be stored in the log buffer, not on disk.
Transaction log records are flushed as log buffers become full, which is why you observed growth before the final COMMIT. The buffer is also flushed when a durable transaction is committed, which guarantees durability.