1
1

Fix a gigantic memory leak. We were copying a message to send into a buffer, then never freeing the copy we made. But we were mistakenly allocating the buffer on the stack, so the memory checking tools never caught the leak. On 96 nodes, 384 processes, mpirun memory usage went from about 12M to 3M for me after this minor change...

This commit was SVN r14257.
Этот коммит содержится в:
Tim Prins 2007-04-07 02:25:48 +00:00
родитель e058266c96
Коммит 8e7765e456

Просмотреть файл

@ -45,14 +45,14 @@ static void orte_gpr_replica_remote_send_cb(
orte_rml_tag_t tag,
void* cbdata)
{
/* Doesn't need to do anything at the moment */
OBJ_RELEASE(req);
return;
}
int orte_gpr_replica_remote_notify(orte_process_name_t *recipient,
orte_gpr_notify_message_t *message)
{
orte_buffer_t buffer;
orte_buffer_t * buffer;
orte_gpr_cmd_flag_t command;
int rc;
@ -60,21 +60,25 @@ int orte_gpr_replica_remote_notify(orte_process_name_t *recipient,
command = ORTE_GPR_NOTIFY_CMD;
OBJ_CONSTRUCT(&buffer, orte_buffer_t);
buffer = OBJ_NEW(orte_buffer_t);
if(NULL == buffer) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
if (ORTE_SUCCESS != (rc = orte_dss.pack(&buffer, &command, 1, ORTE_GPR_CMD))) {
if (ORTE_SUCCESS != (rc = orte_dss.pack(buffer, &command, 1, ORTE_GPR_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dss.pack(&buffer, &message, 1, ORTE_GPR_NOTIFY_MSG))) {
if (ORTE_SUCCESS != (rc = orte_dss.pack(buffer, &message, 1, ORTE_GPR_NOTIFY_MSG))) {
ORTE_ERROR_LOG(rc);
return rc;
}
OPAL_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
if (0 > orte_rml.send_buffer_nb(recipient, &buffer, ORTE_RML_TAG_GPR_NOTIFY, 0,
if (0 > orte_rml.send_buffer_nb(recipient, buffer, ORTE_RML_TAG_GPR_NOTIFY, 0,
orte_gpr_replica_remote_send_cb, NULL)) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
OPAL_THREAD_LOCK(&orte_gpr_replica_globals.mutex);