Index: src/lua/lua_util.c
--- src/lua/lua_util.c.orig
+++ src/lua/lua_util.c
@@ -2539,11 +2539,19 @@ lua_util_get_memory_usage(lua_State *L)
 
 	if (sysctl(mib, 4, &kp, &len, NULL, 0) == 0) {
 		lua_pushstring(L, "rss");
+#ifdef __OpenBSD__
+		lua_pushinteger(L, kp.p_vm_rssize * getpagesize());
+#else
 		lua_pushinteger(L, kp.ki_rssize * getpagesize());
+#endif
 		lua_settable(L, -3);
 
 		lua_pushstring(L, "vsize");
+#ifdef __OpenBSD__
+		lua_pushinteger(L, (kp.p_vm_dsize + kp.p_vm_ssize + kp.p_vm_tsize) * getpagesize());
+#else
 		lua_pushinteger(L, kp.ki_size);
+#endif
 		lua_settable(L, -3);
 	}
 #endif
