Four years ago, as metropolitan government executives met for another seemingly endless session on the fine points of sewer allocations, Montgomery County Executive James P. Gleason, speaking to no one in particular at the conference table, buried his face in his hands.

"I just don't think I can take much more of this crap," he said with a moan.

Ten months ago, frustrated with governmental "paralysis by analysis", the continuous "reinventing of the wheel" by inexperienced, newly elected officials and "too many units of government," Gleason decided he would not take any more. He announced he would not seek a third four-year term as county executive.

Gleason left the job Friday after 27 years of public service. He is still an idealist and a perfectionist, and he left, disappointed that in the final analysis, he could not "make more sense" out of the way government works.

"I've got a problem," the 57-year-old executive said. "I'm not satisfied with half a loaf. I remember my mother once said, 'You'll never be satisfied.' I don't take great satisfaction in not being able to get done what I should have gotten done, and that's why I'm leaving."

An uncompromising fighter for what he determined to be Montgomery County's interests, Gleason spent his eight years as an executive inextricably linked to the regional battles over the 100-mile Metro system and expansion of sewage treatment facilities for new development.

For six years, he fought singlehandedly without the support of the County Council for the Dickerson sewage treatment plant, which opponents contended was three times the size needed for projected population growth.

When he lost, he compromised with the council on a scaled-down version and then tried to get the matter settled in the six months before he left office.

Last year, Gleason withheld millions of dollars in Montgomery County Metro payments, risking the future of the system he helped design, until he won a federal commitment to full completion of 100 miles of subway.

"He didn't have many marbles to play with," said Carlton Sickles, former Prince George's politician and Metro board member. "But he was right, and what he did focused everyone's attention on the problem and finally brought the federal government around to saying that the system had to be built."

From the time he sped through seven years of college and law school at Georgetown University in four and a half years, Gleason, mercurial, blunt and uncompromising, has been compulsive about public service.

First he groomed himself for the U.S. Senate by working for Senators Richard M. Nixon and William F. Knowland in the 1950s and later as an assistant administrator of the National Aeronautics and Space Administration. He settled for local government after losing two Senate bids in Maryland. In 1968, he was appointed to the County Council, and in 1970, he narrowly won election as the first executive of the overwhelmingly Democratic county.

A devout Catholic, an intellectual absorbed by ideas but impatient with the slow process of problem-solving, he saw government as a tool to help people. But he leaves office greatly disillusioned with overregulation, layers of bureaucracy and federal-local combat. Government, he said, "is a disaster... in which nobody decides anything, because everybody is part of the act."

Nevertheless, Gleason, a tall, rumpled man with brooding eyes and a craggy face, has quietly performed individual acts of mercy as executive. As much as anything, that compassion, coupled with his ironic and subtle Irish wit, made him enormously popular in the county.

"The average citizen regarded him as one of us and felt that he was accessible," said David Scotton, a Gleason appointee to the Washington Suburban Sanitary Commission. "Sometimes he was more accessible to these people than (to) his own department heads."

Gleason, who grew up in the Depression in a poor section of Cleveland, Ohio, and dropped out of high school to support his family, has been a frequent sponsor of legislation to help the poor, the handicapped, youths and the elderly.

He carried out his philosophy on an individual as well as legislative level. Last year when a woman dropped by his office with her baby and said she "couldn't make it anymore," Gleason asked the government's carpenters to repair her home during their spare time and directed his assistants to help her apply for a job.

He would go to funerals of slain policemen and those slain by policemen to show the government "cared."

"He felt too many people were missed and fell through the cracks of government," said his longtime press aide, Charles Maier. "You'd be busy as hell and someone would come by and say, 'Mr. Gleason sent me to you.'"

Gleason is particularly fond of youth and the elderly. "They've lost their guile, there's no deception. They say it like it is, and they don't have to prove something," he said

Gleason, too, liked to "say it like it is." Although he insists he does not enjoy battle, his associates believe that his lack of interest in detail, his defiance of political accommodation and his complete self-reliance have been perceived as combative.

"He did his thing," said a Rockville lawyer, Thomas O'Malley, who has known Gleason since college. "That was his approach to government -- and the result was government by adversary procedure."

"It's an impatience," said Maier. "That, more than anything, caused the outlbursts, the walkouts, the throwing down the gauntlet or hoisting up the flag. He never went behind the scenes to persuade people. He thought, if you do what's right, people will follow you."

But in the case of his all-Democratic councils, Gleason said the result was a feeling that he had to run the government "with one arm tied behind my back."

"If we could have put that show on television," Gleason said truculently of his councils, "not a one of them would survive an election. To sit there and listen to nonsense spoken softly." He shook his head. "I cannot take it. I admit it."

Royce Hanson, the county's planning board chairman who has tangled with Gleason, said the executive was "very skilled in casting himself as put-upon by other legislative bodies and the federal government. But no small part of the problem is him... I think he really believes that in spite of the obvious pluralism of American politics, everything ought to be run by the executive."

Gleason, said John Lally, aide to Prince George's County Executive Winfield M. Kelly Jr., "did all his conpromising on his own... Once you sat down at the table with him, there was a black and a white."

Gleason showed this directness everywhere. In a campaign appearance four years ago, rather than currying the favor of the assembled policemen, he tore into them about how "easy" they had it in the county.

As the only local elected member of the minority Republican Party, he refused to make partisan appointments that would strengthen party loyalty and said he made all choices "on merit alone."

He refrained from attending the political social functions that sometimes serve to smooth relationships. During a crucial county lobbying session last Auguust with the Environmental Protection Agency in Philadelphia, he slipped out to visit the Norman Rockwell Museum.

Gleason once advised a new state senator to model himself after Irish Protestant Charles Stewart Parnell whose stock in trade in Parliament was being "the opposition."

Just before he was set to announce his endorsement of Democrat John Menke for county executive last September, Gleason abruptly changed his mind and furiously denied that he had ever considered it. Later, he explained he had gotten angry because Menke's aides were leaking the impending endorsement to the press.

"His greatest strength has been his greatest weakness -- his independence," said State Sen. Howard A. Denis, also a Republican. "It has helped him to be constructive but it hurt him because he has been more and more cut off from the political sources of power that ultimately decide the fate of programs and legislation."

Now a private citizen, Gleason is headed for a semester at Harvard University to ponder government from the other side. He will teach a seminar at the John F. Kennedy Institute of Politics, and write.

When he packed his office last week to make room for his Democratic successor, Charles W. Gilchrist, who takes over tomorrow, Gleason took down the saying that has bolstered him in his public life. It is Abraham Lincoln's concept of "duty," and it says in part: "I do the very best I know how -- and very best I can, and I mean to keep doing so until the end. If the end brings me out all right, what is said against me won't amount to anything. If the end brings me out wrong, then 10 angels swearing I was right will make no difference."