Friday's 3 p.m. staff meeting at the D.C. Department of Corrections had all the trappings of a high-risk poker game, and the gambling instincts of Director James Palmer showed through.

Sitting around a conference table with seven of his advisers, Palmer considered hypothetical situations that would raise or lower population figures at the D.C. Jail through inmate transfers and releases, wagering that during the weekend he could keep the number of prisoners below the court-ordered cap of 1,694.

The stakes were high and the air tense. If Palmer and his aides miscalculated, and the number of inmates at the jail exceeded the ceiling, Palmer and his occasional poker partner, Mayor Marion Barry, could be found in contempt of court and fined thousands of dollars.

"I happen to be a superior juggler," Palmer explained as he and his advisers swapped inmates like chips on the table, shifting them between D.C. Superior Court, the jail, Lorton Reformatory and the city's halfway houses.

The purpose was to achieve a "cushion" of about 25 vacancies at the jail in case of an unexpected surge of lockups during the weekend.

Palmer declared victory after the 4 a.m. count on Saturday: The jail's population was 1,644. Yesterday, the count stood at 1,653, officials said.

On Thursday, when there were 1,683 prisoners at the jail -- 11 below the cap -- most persons agreed that the "smart money" was against Palmer, that 3 1/2 weeks after the Justice Department canceled an agreement to house some of the city's inmates in federal institutions, this probably would be the weekend the jail would go over its cap.

The 4 1/2-month-old agreement, canceled Jan. 15, was made to help the city comply with U.S. District Court Judge William Bryant's Aug. 22 order imposing the limit at the jail.

Justice Department officials have said the program was ended because of the city's delay in constructing a new prison in the city, attributable in part to indecision over where to build it.

Federal and local officials are discussing possible sites, and sources have said that Justice's decision on whether to resume taking city prisoners hinges on how quickly the city begins constructing a new prison and on what interim steps the District takes in implementing short-term solutions to the crowding.

City Administrator Thomas Downs confirmed on Friday that local and federal officials have discussed the possibility of setting up a temporary prison facility in one of the city's fenced, abandoned schools. Other interim measures, which he declined to specify, are being discussed, Downs said, adding that he hopes that a final decision on a short-term solution is reached this week.

In the meantime, the inmate population at the jail and the city's eight other prisons at Lorton Reformatory -- three of which also have court-ordered caps -- continues to climb and threaten the mandated ceilings.

More than anything, federal and local officials agreed, this weekend's inclement weather helped keep the jail population under the ceiling. Cold rain and sleet kept people off the streets and thus lowered crime, reducing significantly the number of people locked up.

Such a reprieve, however, cannot be counted on. And with the number of persons sent to the jail consistently higher than the number released, Palmer recognizes the difficulty of his situation. But, he will not concede defeat: "I cannot sit up as the director of the Department of Corrections and predict doom," he said.

Instead, he and his advisers play a sort of game with inmates that includes keeping a bus stationed at the D.C. Jail throughout the night in case an emergency arises and prisoners have to be transferred to Lorton to make room for new arrivals at the jail.

"The situation with the federal government imposes upon us a method of constantly moving persons every day," Palmer said.

Palmer acknowledged that much of the weekend spillover from the jail goes to Lorton's three minimum-security Occoquan facilities, which on Saturday housed 256 more inmates than their combined capacity of 1,186.

Most of the people added to Occoquan on Friday, however, were "weekenders," or those sentenced to serve their time only on weekends, Palmer said. He added that weekenders were "less likely to be a problem" if put into a crowded facility because most of them have jobs and are close to parole or release.

The city's halfway houses, with a total capacity of 360, also were burdened this weekend, with almost 100 more persons than they are meant to hold.

Because attorneys for inmates at the jail have asked Bryant to hold Barry in contempt and fine him $50,000 for a violation of the cap on Dec. 7 and subsequent alleged attempts to cover it up, projecting the population based on such an inexact science is risky business.

Starting with Friday's 4 a.m. jail count of 1,663, Palmer asked his aides for "the good news." The response was not unlike an auction.

Jail administrator William Long said the U.S. Marshals Service had removed 14 persons from the jail Friday afternoon; the administrator of Lorton's Occoquan I facility had called and said the facility could take 16 inmates; the administrator of the maximum-security facility sent three inmates to the jail, but he said he could take two others in return; the administrator of another Lorton institution could take five adults; there were 15 prisoners at the jail with less than 180 days left on their sentences who could be sent to halfway houses; there were six "rundowns," or inmates who the court had determined could be released provided they had no other charges pending; judges probably would refer about eight inmates to work release programs during the weekend.

Palmer scratched away on a note pad, subtracting and keeping a running tally, then looked up. There were no more deductions, no more good news. "Let me gamble with the 1,600 figure," he said.

Next came the bad news. Palmer grimaced when told that 41 weekenders were expected Friday night and two more on Saturday. However, he was told, only 12 of the 41 were newcomers who would have to have medical examinations and interviews at the jail; the rest could be sent to Occoquan. With the two weekenders expected Saturday, that was a net increase at the jail of 14 inmates.

There were about 18 "stepbacks," or persons who had not been incarcerated pending further adjudication of their cases and who -- for different reasons -- were being sent to the jail by judges.

Next Palmer called the U.S. Marshals Service. D.C. police had locked up 55 persons overnight, and after their pretrial hearings in Superior Court, it was estimated that about 18 would be sent to the jail. Someone mentioned the possibility of lockups from traffic violations over the weekend, or inmates who might have to be sent to the jail after unpredictable incidents at Lorton. Palmer added five for a total of 1,655. He then added an arbitrary 10 percent and leaned back in his chair, looking relieved.

"I can live with 1,670. I'd be delighted with 1,670," he said. "That would give me a 24-inmate cushion for Sunday."

In fact, Palmer explained later, "a lot of little things happened in our favor" that kept the jail at 1,644 on Saturday, including four more people than expected who were eligible for release to halfway houses.

In all, he said, "This will be one of the better weekends I'll have."