I'm trying to call DBus
method of NetworkManager
by using Glib-Dbus
in linux
. When I create a GDBusProxy
by g_dbus_proxy_new_sync and then free it by g_object_unref, the new created GDBusProxy
seems not to be freed. I have used pmap -x <pid>
to display memory usage of my process and the RSS
value increased continuously. Can someone help me?
Here is the code that causes the problem:
int main (int argc, char *argv[]) { GDBusConnection * connection = NULL; GDBusProxy * proxy = NULL; GError * error = NULL; connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error); g_assert_no_error(error); error = NULL; while (1) { proxy = g_dbus_proxy_new_sync(connection, G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS, NULL, "org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager/Settings", "org.freedesktop .NetworkManager.Settings", NULL, NULL); g_assert(proxy != NULL); g_object_unref(proxy); } g_object_unref(connection); return 0; }
Thanks in advance