hald holding up memory by queueing unwanted apm information
yeoching
yeoching at gdc-tech.com
Wed May 7 21:48:29 PDT 2008
Dear friend,
I am using hal-0.10 on fedora 8. After running the machine for 3 days, I
get to see hald is taking up 100MB of memory. I peek into hald, and find
the followings shows up every second, apparently it is trying to get
some power management info from /proc/apm:
=========
gettimeofday({1210058286, 1144}, NULL) = 0
gettimeofday({1210058286, 1324}, NULL) = 0
poll([{fd=5, events=POLLIN}, {fd=9, events=POLLIN}, {fd=11,
events=POLLIN|POLLPRI}, {fd=12, events=POLLPRI}, {fd=13, events=POLLIN},
{fd=15, events=0}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN},
{fd=14, events=POLLIN}, {fd=8, events=POLLIN}], 10, 0) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb767d000
open("//proc/apm", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb767c000
read(3, "1.16ac 1.2 0x07 0x01 0xff 0x80 -"..., 1024) = 40
close(3) = 0
munmap(0xb767c000, 4096) = 0
munmap(0xb767d000, 4096)
=========
My question is, could we just make some external configuration to turn
off this behavior of hald ? It seems like there is no other software
interested in getting apm information, so hald just keep all of them in
queue and consume lots of memory.
Thanks.
Best Regards,
yeoching
ps. After taking a look for /proc/apm in the source code, I wonder it
has something to do with this:
hal-0.5.10/hald/linux/apm.c
==========
276-gboolean
277-apm_synthesize_hotplug_events (void)
278-{
279- gboolean ret;
280- HalDevice *computer;
281- HotplugEvent *hotplug_event;
282-
283- ret = FALSE;
284-
285: if (!g_file_test ("/proc/apm", G_FILE_TEST_EXISTS))
286- goto out;
287-
288- ret = TRUE;
289-
290- if ((computer = hal_device_store_find (hald_get_gdl (),
"/org/freedesktop/Hal/devices/computer")) == NULL &&
291- (computer = hal_device_store_find (hald_get_tdl (),
"/org/freedesktop/Hal/devices/computer")) == NULL) {
292- HAL_ERROR (("No computer object?"));
293- goto out;
294- }
295-
296- /* Set appropriate properties on the computer object */
297- hal_device_property_set_string (computer,
"power_management.type", "apm");
298-
299- hotplug_event = g_new0 (HotplugEvent, 1);
300- hotplug_event->action = HOTPLUG_ACTION_ADD;
301- hotplug_event->type = HOTPLUG_EVENT_APM;
302: g_strlcpy (hotplug_event->apm.apm_path, "/proc/apm", sizeof
(hotplug_event->apm.apm_path));
303- hotplug_event->apm.apm_type = APM_TYPE_BATTERY;
304- hotplug_event_enqueue (hotplug_event);
305-
306- hotplug_event = g_new0 (HotplugEvent, 1);
307- hotplug_event->type = HOTPLUG_EVENT_APM;
308: g_strlcpy (hotplug_event->apm.apm_path, "/proc/apm", sizeof
(hotplug_event->apm.apm_path));
309- hotplug_event->apm.apm_type = APM_TYPE_AC_ADAPTER;
310- hotplug_event_enqueue (hotplug_event);
311-
312- g_timeout_add (APM_POLL_INTERVAL,
313- apm_poll,
314- NULL);
315-
316-out:
317- return ret;
318-}
===============
Hope this help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/hal/attachments/20080508/44f451db/attachment.html
More information about the hal
mailing list