<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1"><font face="Tahoma"><br>
Dear friend,<br>
<br>
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:<br>
<br>
=========<br>
gettimeofday({1210058286, 1144}, NULL) = 0<br>
gettimeofday({1210058286, 1324}, NULL) = 0<br>
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<br>
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb767d000<br>
open("//proc/apm", O_RDONLY|O_LARGEFILE) = 3<br>
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0<br>
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb767c000<br>
read(3, "1.16ac 1.2 0x07 0x01 0xff 0x80 -"..., 1024) = 40<br>
close(3) = 0<br>
munmap(0xb767c000, 4096) = 0<br>
munmap(0xb767d000, 4096) <br>
=========<br>
<br>
<br>
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.<br>
<br>
<br>
Thanks.<br>
<br>
Best Regards,<br>
yeoching<br>
<br>
<br>
<br>
<br>
ps. After taking a look for /proc/apm in the source code, I wonder it
has something to do with this:<br>
<br>
hal-0.5.10/hald/linux/apm.c<br>
==========<br>
276-gboolean<br>
277-apm_synthesize_hotplug_events (void)<br>
278-{<br>
279- gboolean ret;<br>
280- HalDevice *computer;<br>
281- HotplugEvent *hotplug_event;<br>
282-<br>
283- ret = FALSE;<br>
284-<br>
285: if (!g_file_test ("/proc/apm", G_FILE_TEST_EXISTS))<br>
286- goto out;<br>
287-<br>
288- ret = TRUE;<br>
289-<br>
290- if ((computer = hal_device_store_find (hald_get_gdl (),
"/org/freedesktop/Hal/devices/computer")) == NULL &&<br>
291- (computer = hal_device_store_find (hald_get_tdl (),
"/org/freedesktop/Hal/devices/computer")) == NULL) {<br>
292- HAL_ERROR (("No computer object?"));<br>
293- goto out;<br>
294- }<br>
295-<br>
296- /* Set appropriate properties on the computer object */<br>
297- hal_device_property_set_string (computer,
"power_management.type", "apm");<br>
298-<br>
299- hotplug_event = g_new0 (HotplugEvent, 1);<br>
300- hotplug_event->action = HOTPLUG_ACTION_ADD;<br>
301- hotplug_event->type = HOTPLUG_EVENT_APM;<br>
302: g_strlcpy (hotplug_event->apm.apm_path, "/proc/apm", sizeof
(hotplug_event->apm.apm_path));<br>
303- hotplug_event->apm.apm_type = APM_TYPE_BATTERY;<br>
304- hotplug_event_enqueue (hotplug_event);<br>
305-<br>
306- hotplug_event = g_new0 (HotplugEvent, 1);<br>
307- hotplug_event->type = HOTPLUG_EVENT_APM;<br>
308: g_strlcpy (hotplug_event->apm.apm_path, "/proc/apm", sizeof
(hotplug_event->apm.apm_path));<br>
309- hotplug_event->apm.apm_type = APM_TYPE_AC_ADAPTER;<br>
310- hotplug_event_enqueue (hotplug_event);<br>
311-<br>
312- g_timeout_add (APM_POLL_INTERVAL,<br>
313- apm_poll,<br>
314- NULL);<br>
315-<br>
316-out:<br>
317- return ret;<br>
318-}<br>
===============<br>
<br>
Hope this help.<br>
<br>
<br>
</font></font>
</body>
</html>