How to stop OLED flicker when using SSD1306Ascii.h?
Your loop is repeatedly writing and clearing the display, nearly as fast as possible (minus the 1ms delay at the bottom), which is the reason for the flicker you're seeing. If instead, you only update the display when something changes, it will look much smoother. Even a clear-and-rewrite the entire display when something changes (assuming the changes are infrequent) will be a major improvement. Of course this assumes you'd eventually be writing dynamic data; your test program, of course, writes and re-writes static data.

Update:


  If I run the same code structure with Adafruit library there is no
  flicker, even with no delay in the loop.


Can you compare the two libraries to see what they do differently?


  The Adafruit library does not have this issue, but I've been told uses
  a lot of memory


There's a likely clue: Adafruit may be buffering the display contents in memory so it can find out which character positions changed and update only those. That would be a classic time/space trade-off.