Two four-star generals will have retired from the Joint Chiefs of Staff by the end of this month, Army Gen. E.C. Meyer and Marine Commandant Robert H. Barrow.

They both leave their posts with high praise from their comrades-in-arms and civilian superiors.

But their departures raise a big question inside the Pentagon about age. Are we letting go of the military's best too soon?

Meyer, credited with filling many of the spaces in the Army he once described as "hollow" and with rekindling its esprit de corps by emphasizing career-long attachments to regiments, left his post last week at the ripe old age of 54.

Barrow, whom President Reagan had tentatively selected as chairman of the Joint Chiefs only to be talked out of it on the grounds that it was too high a post for the head of the smallest service, has been a Marine for 41 years.

He enlisted in March, 1942, served as an assistant drill instructor and rose to four-star rank, partly because of his exploits as an officer behind the lines in China during World War II and partly because of his administrative skills, as demonstrated in his battle against brutality in recruit training.

He is scheduled to retire Thursday as the old man of the Joint Chiefs of Staff, the last to have served in World War II. He is 61.

By contrast, Reagan, the commander in chief, is 72. Defense Secretary Caspar W. Weinberger, the military's boss in the Pentagon, is 65. A case could be made that their duty is as strenuous as that of four-star generals.

Going back in history when men did not live as long as they do today, the record shows that Gen. Robert E. Lee, no slouch as a military leader, was 58 when he surrendered his Confederate troops to Union Gen. Ulysses S. Grant at Appomattox Court House, Va., in 1865. (Grant was 42.)

More recently, the hard-charging tank commander of World War II fame, Gen. George S. Patton Jr., was 61 when that war ended. Gen. Dwight D. Eisenhower, by contrast, was Meyer's age--54--at war's end, and went on, of course, to became president of the United States. Gen. Matthew B. Ridgway was 57 when he commanded U.N. troops in Korea in 1952, and went on to hold other demanding military posts.

Meyer said in a farewell interview that he is not ready to be an old soldier and fade away. "I want to run something," he said.

Barrow does intend to fade away to his beloved Rosale Plantation in St. Francisville, La., at least for a while. "I'm not going to be one of those guys who stays in Washington and tells other people what to do," he once said.

Since Meyer still wants "to run something," does he feel something is wrong with a system that releases him from the Army at such an early age? He said "no."

But the rising cost of paying military retirees, estimated to be $16.8 billion for fiscal 1984, is forcing Pentagon officials to ask whether they are letting military people retire too soon.

Under the present system, a soldier may retire at half pay after 20 years' service and at three-quarters of his salary after 30 years.

Tidal W. McCoy, assistant secretary of the Air Force for manpower, warns against tinkering with the retirement system and says that the nation found itself at the start of World War II with overage generals who could not hack it on the battlefield.

In a paper defending the current retirement options, he wrote, "The demands of their calling clearly set military members apart from the rest of society. Only 12 percent of those who enter active duty ever receive any retirement compensation at all."

The present system is designed to "provide experience for the officer force at an early age, to keep promotion at acceptable levels and to maintain a younger force," he added.

The Pentagon is, nevertheless, studying alternatives to the present retirement system. But, there is widespread agreement inside the Pentagon and Congress that any changes should not apply to those now in uniform.